refactor: put dynamic imports at the top of the file

This commit is contained in:
WofWca 2023-02-28 14:07:19 +04:00
parent 67f3277ae2
commit eda1df19dc
1 changed files with 6 additions and 3 deletions

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 })