Skip to content

Commit

Permalink
refactor(noti): use Date.now() instead of new Date().getTime() (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini-ghost authored Dec 7, 2023
1 parent 9b8774b commit 790b5a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/composables/useCreateNoti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 790b5a3

Please sign in to comment.