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