From e123d4f825bb21d0c424dc8e90b62499d7553eb3 Mon Sep 17 00:00:00 2001 From: WofWca Date: Tue, 16 Jan 2024 14:24:24 +0000 Subject: [PATCH] chore(perf): import some modules dynamically (#3179) Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/3179 Reviewed-by: konrad Co-authored-by: WofWca Co-committed-by: WofWca --- src/App.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.vue b/src/App.vue index 95087120a..77d3dacf4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -37,8 +37,6 @@ import NoAuthWrapper from '@/components/misc/no-auth-wrapper.vue' import Ready from '@/components/misc/ready.vue' import {setLanguage} from '@/i18n' -import AccountDeleteService from '@/services/accountDelete' -import {success} from '@/message' import {useAuthStore} from '@/stores/auth' import {useBaseStore} from '@/stores/base' @@ -48,6 +46,9 @@ import {useBodyClass} from '@/composables/useBodyClass' import AddToHomeScreen from '@/components/home/AddToHomeScreen.vue' import DemoMode from '@/components/home/DemoMode.vue' +const importAccountDeleteService = () => import('@/services/accountDelete') +const importMessage = () => import('@/message') + const baseStore = useBaseStore() const authStore = useAuthStore() const router = useRouter() @@ -68,8 +69,11 @@ watch(accountDeletionConfirm, async (accountDeletionConfirm) => { return } + const messageP = importMessage() + const AccountDeleteService = (await importAccountDeleteService()).default const accountDeletionService = new AccountDeleteService() await accountDeletionService.confirm(accountDeletionConfirm) + const {success} = await messageP success({message: t('user.deletion.confirmSuccess')}) authStore.refreshUserInfo() }, { immediate: true })