upd: move the prompting of the id verification from page into router

This commit is contained in:
Marie 2024-09-11 22:04:36 +02:00
parent 2eaff3388f
commit 74e720c294
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555
6 changed files with 54 additions and 13 deletions

View file

@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: marie and sharkey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { defineAsyncComponent } from 'vue';
import { $i } from '@/account.js';
import { popup } from '@/os.js';
export function confirmId(path?: string) {
if ($i && !$i.idCheckRequired) return;
const { dispose } = popup(defineAsyncComponent(() => import('@/components/SkStripeIdDialog.vue')), {
}, {
closed: () => {
dispose()
if (path) {
window.location.href = path;
}
},
});
throw new Error('id confirmation required');
}