mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-25 00:49:17 +09:00
refactor
This commit is contained in:
parent
ea3db748c7
commit
acdeb5cc44
@ -62,8 +62,10 @@ export function parseEmbedParams(searchParams: URLSearchParams | string): Parsed
|
||||
let _searchParams: URLSearchParams;
|
||||
if (typeof searchParams === 'string') {
|
||||
_searchParams = new URLSearchParams(searchParams);
|
||||
} else {
|
||||
} else if (searchParams instanceof URLSearchParams) {
|
||||
_searchParams = searchParams;
|
||||
} else {
|
||||
throw new Error('searchParams must be URLSearchParams or string');
|
||||
}
|
||||
|
||||
const params: EmbedParams = {};
|
||||
|
@ -2,6 +2,7 @@
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { url } from '@/config.js';
|
||||
import { MOBILE_THRESHOLD } from '@/const.js';
|
||||
@ -9,7 +10,6 @@ import * as os from '@/os.js';
|
||||
import copy from '@/scripts/copy-to-clipboard.js';
|
||||
import type { EmbedParams, EmbeddableEntity } from '@/scripts/embed-page.js';
|
||||
import { defaultEmbedParams, embedRouteWithScrollbar } from '@/scripts/embed-page.js';
|
||||
import MkEmbedCodeGenDialog from '@/components/MkEmbedCodeGenDialog.vue';
|
||||
|
||||
/**
|
||||
* パラメータを正規化する(埋め込みコード作成用)
|
||||
@ -76,7 +76,7 @@ export function copyEmbedCode(entity: EmbeddableEntity, idOrUsername: string, pa
|
||||
copy(getEmbedCode(`/embed/${entity}/${_idOrUsername}`, _params));
|
||||
os.success();
|
||||
} else {
|
||||
const { dispose } = os.popup(MkEmbedCodeGenDialog, {
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkEmbedCodeGenDialog.vue')), {
|
||||
entity,
|
||||
idOrUsername,
|
||||
params: _params,
|
||||
|
Loading…
Reference in New Issue
Block a user