From 7dcefe09cc155368e9f209b1ba829288fa584be6 Mon Sep 17 00:00:00 2001 From: Alex Liu Date: Wed, 29 Nov 2023 08:56:44 +0800 Subject: [PATCH] refactor(noti): use `Date.now()` instead of `new Date().getTime()` --- packages/core/src/composables/useCreateNoti.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/src/composables/useCreateNoti.ts b/packages/core/src/composables/useCreateNoti.ts index e1af71b..4d257f5 100644 --- a/packages/core/src/composables/useCreateNoti.ts +++ b/packages/core/src/composables/useCreateNoti.ts @@ -37,8 +37,7 @@ export function useCreateNoti(options: UseCreateNotiOptions) { function triggerCountDown(target: Notification) { const interval = setInterval(() => { - const now = new Date() - const lastTime = target.timer.endCountDownTimestamp - now.getTime() + const lastTime = target.timer.endCountDownTimestamp - Date.now() if (lastTime > 0) { target.timer.lastTime = lastTime return