diff --git a/console/uc-src/modules/profile/components/EmailVerifyModal.vue b/console/uc-src/modules/profile/components/EmailVerifyModal.vue index 9e72090d1..2d283e26c 100644 --- a/console/uc-src/modules/profile/components/EmailVerifyModal.vue +++ b/console/uc-src/modules/profile/components/EmailVerifyModal.vue @@ -2,7 +2,7 @@ import { Toast, VButton, VSpace } from "@halo-dev/components"; import { VModal } from "@halo-dev/components"; -import { nextTick, onMounted, ref } from "vue"; +import { ref } from "vue"; import { useMutation, useQueryClient } from "@tanstack/vue-query"; import { apiClient } from "@/utils/api-client"; import { useUserStore } from "@/stores/user"; @@ -19,24 +19,7 @@ const emit = defineEmits<{ (event: "close"): void; }>(); -// fixme: refactor VModal component -const shouldRender = ref(false); -const visible = ref(false); - -onMounted(() => { - shouldRender.value = true; - nextTick(() => { - visible.value = true; - }); -}); - -function onClose() { - visible.value = false; - setTimeout(() => { - shouldRender.value = false; - emit("close"); - }, 200); -} +const modal = ref(); // count down const timer = ref(0); @@ -111,7 +94,7 @@ const { mutate: verifyEmail, isLoading: isVerifying } = useMutation({ ); queryClient.invalidateQueries({ queryKey: ["user-detail"] }); fetchCurrentUser(); - onClose(); + modal.value.close(); }, }); @@ -122,14 +105,13 @@ function handleVerify(data: { code: string }) {