Update FriendNotifications.plugin.js

This commit is contained in:
Mirco Wittrien 2021-02-12 17:07:48 +01:00
parent a86ad88be5
commit 1e9405089f
1 changed files with 13 additions and 16 deletions

View File

@ -773,23 +773,20 @@ module.exports = (_ => {
onClick: openChannel onClick: openChannel
}); });
} }
else if (!document.querySelector(`.friendnotifications-${id}-toast`)) { else BDFDB.NotificationUtils.toast(BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(toastString)), {
BDFDB.NotificationUtils.toast(BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(toastString)), { timeout: amounts.toastTime * 1000,
className: `friendnotifications-${status.name}-toast friendnotifications-${id}-toast`, avatar: avatar,
timeout: amounts.toastTime * 1000, barColor: BDFDB.UserUtils.getStatusColor(status.name, true),
avatar: avatar, onClick: openChannel,
barColor: BDFDB.UserUtils.getStatusColor(status.name, true), onShow: _ => {
onClick: openChannel, let notificationSound = notificationSounds["toast" + status.name] || {};
onShow: _ => { if (!notificationSound.mute && notificationSound.song) {
let notificationSound = notificationSounds["toast" + status.name] || {}; let audio = new Audio();
if (!notificationSound.mute && notificationSound.song) { audio.src = notificationSound.song;
let audio = new Audio(); audio.play();
audio.src = notificationSound.song;
audio.play();
}
} }
}); }
} });
} }
} }
userStatusStore[id] = status; userStatusStore[id] = status;