diff --git a/app/app.constants.js b/app/app.constants.js index 66de5ce..adbad03 100644 --- a/app/app.constants.js +++ b/app/app.constants.js @@ -53,6 +53,7 @@ export const defaultCommonSetting = { idAbNumberFilterSearchisDefaultValue: true, idAbPauseFor: "15-30S", idAbSoundToggle: true, + idAbSoundVolume: 100, idAbStopAfter: "1-2H", idAbStopErrorCodeCount: 3, idAbWaitTime: "5-8", diff --git a/app/elementIds.constants.js b/app/elementIds.constants.js index 7926ed2..5eb2bd8 100644 --- a/app/elementIds.constants.js +++ b/app/elementIds.constants.js @@ -31,6 +31,7 @@ export const idAbMessageNotificationToggle = "elem_" + generateId(15); export const idAbCustomDiscordNameNotificationToggle = "elem_" + generateId(15); export const idAbSendListingNotificationToggle = "elem_" + generateId(15); export const idAbSoundToggle = "elem_" + generateId(15); +export const idAbSoundVolume = "elem_" + generateId(15); export const idTelegramBotToken = "elem_" + generateId(15); export const idTelegramChatId = "elem_" + generateId(15); export const idNotificationType = "elem_" + generateId(15); diff --git a/app/utils/commonUtil.js b/app/utils/commonUtil.js index 47cbaac..af63a3d 100644 --- a/app/utils/commonUtil.js +++ b/app/utils/commonUtil.js @@ -163,7 +163,7 @@ export const playAudio = function (eventType) { } else if (eventType == "cardWon") { elem = document.getElementById(ElementIds.idWinMp3); } - + elem.volume = (buyerSetting["idAbSoundVolume"] && buyerSetting["idAbSoundVolume"] > 0 && buyerSetting["idAbSoundVolume"] <= 100 ? (buyerSetting["idAbSoundVolume"] / 100).toFixed(2) : 1); elem.currentTime = 0; elem.play(); } diff --git a/app/views/layouts/Settings/NotificationSettingsView.js b/app/views/layouts/Settings/NotificationSettingsView.js index 16c58a7..c92f33b 100644 --- a/app/views/layouts/Settings/NotificationSettingsView.js +++ b/app/views/layouts/Settings/NotificationSettingsView.js @@ -3,6 +3,7 @@ import { idAbMessageNotificationToggle, idAbSendListingNotificationToggle, idAbSoundToggle, + idAbSoundVolume, idCapatchaMp3, idDiscordChannelId, idDiscordToken, @@ -95,6 +96,13 @@ export const notificationSettingsView = function () { { idAbMessageNotificationToggle }, "", "CommonSettings" + )} + ${generateTextInput( + "Sound Volume", + 100, + { idAbSoundVolume }, + "in percent", + "CommonSettings" )} ${ !isMarketAlertApp