1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-08-18 13:31:41 +02:00

Fix clicking 'Play' in 'Options - Sounds' not playing notification if notifications are muted

Closes 
This commit is contained in:
2022-01-17 21:03:35 +01:00
parent 2a636245b4
commit 24f5075116
3 changed files with 9 additions and 5 deletions
Dialogs
Resources/Content/tweetdeck
lib/TweetLib.Core/Features/TweetDeck

@@ -42,7 +42,7 @@ namespace TweetDuck.Dialogs {
AddButton("General", () => new TabSettingsGeneral(tweetDeckFunctions.ReloadColumns, updates));
AddButton("Notifications", () => new TabSettingsNotifications(this.browser.CreateExampleNotification()));
AddButton("Sounds", () => new TabSettingsSounds(tweetDeckFunctions.PlaySoundNotification));
AddButton("Sounds", () => new TabSettingsSounds(() => tweetDeckFunctions.PlaySoundNotification(true)));
AddButton("Tray", () => new TabSettingsTray());
AddButton("Feedback", () => new TabSettingsFeedback());
AddButton("Advanced", () => new TabSettingsAdvanced(tweetDeckFunctions.ReinjectCustomCSS, this.browser.OpenDevTools));

@@ -31,12 +31,16 @@ export default function() {
audio.load();
};
window.TDGF_playSoundNotification = function() {
let forcePlayNotification = false;
window.TDGF_playSoundNotification = function(force) {
forcePlayNotification = force;
document.getElementById("update-sound").play();
forcePlayNotification = false;
};
replaceFunction(HTMLAudioElement.prototype, "play", function(func, args) {
if (!$TDX.muteNotifications && isAppReady()) {
if ((!$TDX.muteNotifications || forcePlayNotification) && isAppReady()) {
func.apply(this, args);
}
});

@@ -35,8 +35,8 @@ namespace TweetLib.Core.Features.TweetDeck {
executor.RunFunction("TDGF_reloadColumns");
}
public void PlaySoundNotification() {
executor.RunFunction("TDGF_playSoundNotification");
public void PlaySoundNotification(bool force) {
executor.RunFunction("TDGF_playSoundNotification", force);
}
public void ApplyROT13() {