From 0f633b98b0933e5f3844f6200633e3fa95777f24 Mon Sep 17 00:00:00 2001 From: notfire Date: Tue, 11 Feb 2025 09:24:39 -0500 Subject: [PATCH] fix notif sounds for general users being pulled from ones for specific users --- src/services/notification_utils/notification_utils.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/services/notification_utils/notification_utils.js b/src/services/notification_utils/notification_utils.js index f61a956d..f88af71f 100644 --- a/src/services/notification_utils/notification_utils.js +++ b/src/services/notification_utils/notification_utils.js @@ -140,9 +140,11 @@ export const prepareNotificationObject = (notification, i18n, store) => { var soundVol var soundList = store.getters.mergedConfig.soundOnNotifCustom.split("\n") var randomSound + var indexesToRemove = [] soundList.forEach(sound => { // if there's more args, assume specific user tied to sound if (sound.split(";").length > 2) { + indexesToRemove.push(soundList.indexOf(sound)) var user = [sound.split(";")[2]] if (user == notification.from_profile.id) { randomSound = sound.split(";")[0] @@ -151,6 +153,10 @@ export const prepareNotificationObject = (notification, i18n, store) => { } } }); + // ensure we remove the sounds with > 2 args + indexesToRemove.forEach(index => { + soundList.splice(index, 1) + }) if (fallback) { randomSound = soundList[Math.floor(Math.random() * soundList.length)] soundVol = (randomSound.split(";").length > 1 ? randomSound.split(";")[1] : store.getters.mergedConfig.soundOnNotifVolume)