mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-10-26 02:48:47 -04:00
show native notification when a new message is received
This commit is contained in:
parent
a697cf4777
commit
5a522dbd6f
1 changed files with 9 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue