This commit is contained in:
kakkokari-gtyih 2024-07-18 20:20:41 +09:00
parent e6e599ee8c
commit a7ab15319b
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import { v4 as uuid } from 'uuid';
import { url } from '@/config.js'; import { url } from '@/config.js';
import { MOBILE_THRESHOLD } from '@/const.js'; import { MOBILE_THRESHOLD } from '@/const.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import copy from '@/scripts/copy-to-clipboard.js'; import { copyToClipboard } from '@/scripts/copy-to-clipboard.js';
import type { EmbedParams, EmbeddableEntity } from '@/scripts/embed-page.js'; import type { EmbedParams, EmbeddableEntity } from '@/scripts/embed-page.js';
import { defaultEmbedParams, embedRouteWithScrollbar } from '@/scripts/embed-page.js'; import { defaultEmbedParams, embedRouteWithScrollbar } from '@/scripts/embed-page.js';
@ -73,7 +73,7 @@ export function copyEmbedCode(entity: EmbeddableEntity, idOrUsername: string, pa
// PCじゃない場合はコードカスタマイズ画面を出さずにそのままコピー // PCじゃない場合はコードカスタマイズ画面を出さずにそのままコピー
if (window.innerWidth < MOBILE_THRESHOLD) { if (window.innerWidth < MOBILE_THRESHOLD) {
const _idOrUsername = entity === 'user-timeline' ? `@${idOrUsername}` : idOrUsername; const _idOrUsername = entity === 'user-timeline' ? `@${idOrUsername}` : idOrUsername;
copy(getEmbedCode(`/embed/${entity}/${_idOrUsername}`, _params)); copyToClipboard(getEmbedCode(`/embed/${entity}/${_idOrUsername}`, _params));
os.success(); os.success();
} else { } else {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkEmbedCodeGenDialog.vue')), { const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkEmbedCodeGenDialog.vue')), {