forked from mirrors/misskey
enhance(frontend): 非同期的なコンポーネントの読み込み時のハンドリングを強化
This commit is contained in:
@@ -3,11 +3,10 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
import { $i } from '@/i.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { popup } from '@/os.js';
|
||||
import { popupAsyncWithDialog } from '@/os.js';
|
||||
|
||||
export type OpenOnRemoteOptions = {
|
||||
/**
|
||||
@@ -45,7 +44,7 @@ export type OpenOnRemoteOptions = {
|
||||
params: Record<string, string>;
|
||||
};
|
||||
|
||||
export function pleaseLogin(opts: {
|
||||
export async function pleaseLogin(opts: {
|
||||
path?: string;
|
||||
message?: string;
|
||||
openOnRemote?: OpenOnRemoteOptions;
|
||||
@@ -59,7 +58,7 @@ export function pleaseLogin(opts: {
|
||||
_openOnRemote = opts.openOnRemote;
|
||||
}
|
||||
|
||||
const { dispose } = popup(defineAsyncComponent(() => import('@/components/MkSigninDialog.vue')), {
|
||||
const { dispose } = await popupAsyncWithDialog(import('@/components/MkSigninDialog.vue').then(x => x.default), {
|
||||
autoSet: true,
|
||||
message: opts.message ?? (_openOnRemote ? i18n.ts.signinOrContinueOnRemote : i18n.ts.signinRequired),
|
||||
openOnRemote: _openOnRemote,
|
||||
|
||||
Reference in New Issue
Block a user