Merge pull request #495 from DrakeRichards/vladmandic-notifications-fix

Fix multiple notifications on refresh
This commit is contained in:
Vladimir Mandic
2023-04-25 19:20:16 -04:00
committed by GitHub
+5 -1
View File
@@ -2,7 +2,9 @@
let lastHeadImg = null;
notificationButton = null
let notificationButton = null;
const regExpTempImage = /(?<=\/|\\)tmp[\w\d]{8}\.png$/gm;
onUiUpdate(function(){
if(notificationButton == null){
@@ -23,6 +25,8 @@ onUiUpdate(function(){
if (headImg == null || headImg == lastHeadImg) return;
if (headImg.search(regExpTempImage) != -1) return;
lastHeadImg = headImg;
// play notification sound if available