From 493c5965afaca07ea40f6bae7994b28049b5cfa3 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Sun, 24 Jan 2021 14:05:34 +0100 Subject: [PATCH] stuff --- Library/_res/BDFDB.data.json | 6 +++--- .../FriendNotifications.plugin.js | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Library/_res/BDFDB.data.json b/Library/_res/BDFDB.data.json index 17036aaa2e..fc63cdf137 100644 --- a/Library/_res/BDFDB.data.json +++ b/Library/_res/BDFDB.data.json @@ -358,7 +358,7 @@ "icon": "" }, "CHECKMARK_CIRCLE": { - "icon": "" + "icon": "" }, "CLOSE": { "defaultProps": { @@ -408,7 +408,7 @@ "icon": "" }, "INFO": { - "icon": "" + "icon": "" }, "LEFT_CARET": { "icon": "" @@ -490,7 +490,7 @@ "icon": "" }, "WARNING": { - "icon": "" + "icon": "" } }, "CustomClassModules": { diff --git a/Plugins/FriendNotifications/FriendNotifications.plugin.js b/Plugins/FriendNotifications/FriendNotifications.plugin.js index c63981ba39..02844713d9 100644 --- a/Plugins/FriendNotifications/FriendNotifications.plugin.js +++ b/Plugins/FriendNotifications/FriendNotifications.plugin.js @@ -775,22 +775,22 @@ module.exports = (_ => { if (observedUsers[id][status.name] == notificationTypes.DESKTOP.value) { let desktopString = string.replace(/\$user/g, `${name}${settings.showDiscriminator ? ("#" + user.discriminator) : ""}`).replace(/\$status/g, statusName); if (status.activity) desktopString = desktopString.replace(/\$song|\$game/g, status.activity.name || status.activity.details || "").replace(/\$artist|\$custom/g, [status.activity.emoji && status.activity.emoji.name, status.activity.state].filter(n => n).join(" ") || ""); - let notificationsound = notificationSounds["desktop" + status.name] || {}; - BDFDB.NotificationUtils.desktop(desktopString, {icon: avatar, timeout: desktopTime, click: openChannel, silent: notificationsound.mute, sound: notificationsound.song}); + let notificationSound = notificationSounds["desktop" + status.name] || {}; + BDFDB.NotificationUtils.desktop(desktopString, {icon: avatar, timeout: desktopTime, click: openChannel, silent: notificationSound.mute, sound: notificationSound.song}); } else if (!document.querySelector(`.friendnotifications-${id}-toast`)) { - let toast = BDFDB.NotificationUtils.toast(`
${toastString}
`, { + BDFDB.NotificationUtils.toast(toastString, { className: `friendnotifications-${status.name}-toast friendnotifications-${id}-toast`, html: true, timeout: toastTime, + avatar: avatar, color: BDFDB.UserUtils.getStatusColor(status.name), - icon: false + onClick: openChannel }); - toast.addEventListener("click", openChannel); - let notificationsound = notificationSounds["toast" + status.name] || {}; - if (!notificationsound.mute && notificationsound.song) { + let notificationSound = notificationSounds["toast" + status.name] || {}; + if (!notificationSound.mute && notificationSound.song) { let audio = new Audio(); - audio.src = notificationsound.song; + audio.src = notificationSound.song; audio.play(); } }