Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setting for sound volume #822

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/app.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const defaultCommonSetting = {
idAbNumberFilterSearchisDefaultValue: true,
idAbPauseFor: "15-30S",
idAbSoundToggle: true,
idAbSoundVolume: 100,
idAbStopAfter: "1-2H",
idAbStopErrorCodeCount: 3,
idAbWaitTime: "5-8",
Expand Down
1 change: 1 addition & 0 deletions app/elementIds.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/utils/commonUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
8 changes: 8 additions & 0 deletions app/views/layouts/Settings/NotificationSettingsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
idAbMessageNotificationToggle,
idAbSendListingNotificationToggle,
idAbSoundToggle,
idAbSoundVolume,
idCapatchaMp3,
idDiscordChannelId,
idDiscordToken,
Expand Down Expand Up @@ -95,6 +96,13 @@ export const notificationSettingsView = function () {
{ idAbMessageNotificationToggle },
"",
"CommonSettings"
)}
${generateTextInput(
"Sound Volume",
100,
{ idAbSoundVolume },
"in percent",
"CommonSettings"
)}
${
!isMarketAlertApp
Expand Down