Skip to content

Commit

Permalink
notification disappear automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanminutillo committed Jun 27, 2024
1 parent e265e86 commit d7b70d8
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ export default {
console.debug("notification permission is already granted ")
}
this.handleEvent("notify", ({ title, message, url, icon }) => sendNotification(title, message, url, icon));

const notificationElement = this.el;
setTimeout(() => {
notificationElement.style.transition = "opacity 0.5s ease-out";
notificationElement.style.opacity = "0";
setTimeout(() => {
notificationElement.remove();
}, 500);
}, 5000);
}
}

Expand Down

0 comments on commit d7b70d8

Please sign in to comment.