1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-28 18:15:47 +02:00

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

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

View File

@ -42,7 +42,7 @@ public FormSettings(FormBrowser browser, PluginManager plugins, UpdateChecker up
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));

View File

@ -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);
}
});

View File

@ -35,8 +35,8 @@ public void ReloadColumns() {
executor.RunFunction("TDGF_reloadColumns");
}
public void PlaySoundNotification() {
executor.RunFunction("TDGF_playSoundNotification");
public void PlaySoundNotification(bool force) {
executor.RunFunction("TDGF_playSoundNotification", force);
}
public void ApplyROT13() {