show native notification when a new message is received

This commit is contained in:
liamcottle 2024-07-07 21:10:26 +12:00
parent a697cf4777
commit 5a522dbd6f

View file

@ -1404,6 +1404,15 @@
}
// show notification for new messages when using electron
Notification.requestPermission().then((result) => {
if(result === "granted"){
new window.Notification("New Message", {
body: "Someone sent you a message.",
});
}
});
// auto scroll to bottom if we want to
if(this.autoScrollOnNewMessage){
this.scrollMessagesToBottom();