perf: import some modules dynamically #3179

Merged
konrad merged 3 commits from WofWca/frontend:dynamic-import into main 2024-01-16 14:24:26 +00:00
Showing only changes of commit eda1df19dc - Show all commits

View File

@ -46,6 +46,9 @@ import {useBodyClass} from '@/composables/useBodyClass'
import AddToHomeScreen from '@/components/home/AddToHomeScreen.vue'
import DemoMode from '@/components/home/DemoMode.vue'
const importAccountDeleteService = async () => (await import('@/services/accountDelete')).default
const importSuccess = async () => (await import('@/message')).success
const baseStore = useBaseStore()
const authStore = useAuthStore()
const router = useRouter()
@ -66,11 +69,11 @@ watch(accountDeletionConfirm, async (accountDeletionConfirm) => {
return
}
const messageP = import('@/message')
const AccountDeleteService = (await import('@/services/accountDelete')).default
const successP = importSuccess()
const AccountDeleteService = await importAccountDeleteService()
const accountDeletionService = new AccountDeleteService()
await accountDeletionService.confirm(accountDeletionConfirm)
const {success} = await messageP
const success = await successP
success({message: t('user.deletion.confirmSuccess')})
authStore.refreshUserInfo()
}, { immediate: true })