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 #326
This commit is contained in:
parent
2a636245b4
commit
24f5075116
Dialogs
Resources/Content/tweetdeck
lib/TweetLib.Core/Features/TweetDeck
@ -42,7 +42,7 @@ public FormSettings(FormBrowser browser, PluginManager plugins, UpdateChecker up
|
|||||||
|
|
||||||
AddButton("General", () => new TabSettingsGeneral(tweetDeckFunctions.ReloadColumns, updates));
|
AddButton("General", () => new TabSettingsGeneral(tweetDeckFunctions.ReloadColumns, updates));
|
||||||
AddButton("Notifications", () => new TabSettingsNotifications(this.browser.CreateExampleNotification()));
|
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("Tray", () => new TabSettingsTray());
|
||||||
AddButton("Feedback", () => new TabSettingsFeedback());
|
AddButton("Feedback", () => new TabSettingsFeedback());
|
||||||
AddButton("Advanced", () => new TabSettingsAdvanced(tweetDeckFunctions.ReinjectCustomCSS, this.browser.OpenDevTools));
|
AddButton("Advanced", () => new TabSettingsAdvanced(tweetDeckFunctions.ReinjectCustomCSS, this.browser.OpenDevTools));
|
||||||
|
@ -31,12 +31,16 @@ export default function() {
|
|||||||
audio.load();
|
audio.load();
|
||||||
};
|
};
|
||||||
|
|
||||||
window.TDGF_playSoundNotification = function() {
|
let forcePlayNotification = false;
|
||||||
|
|
||||||
|
window.TDGF_playSoundNotification = function(force) {
|
||||||
|
forcePlayNotification = force;
|
||||||
document.getElementById("update-sound").play();
|
document.getElementById("update-sound").play();
|
||||||
|
forcePlayNotification = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
replaceFunction(HTMLAudioElement.prototype, "play", function(func, args) {
|
replaceFunction(HTMLAudioElement.prototype, "play", function(func, args) {
|
||||||
if (!$TDX.muteNotifications && isAppReady()) {
|
if ((!$TDX.muteNotifications || forcePlayNotification) && isAppReady()) {
|
||||||
func.apply(this, args);
|
func.apply(this, args);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -35,8 +35,8 @@ public void ReloadColumns() {
|
|||||||
executor.RunFunction("TDGF_reloadColumns");
|
executor.RunFunction("TDGF_reloadColumns");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlaySoundNotification() {
|
public void PlaySoundNotification(bool force) {
|
||||||
executor.RunFunction("TDGF_playSoundNotification");
|
executor.RunFunction("TDGF_playSoundNotification", force);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyROT13() {
|
public void ApplyROT13() {
|
||||||
|
Loading…
Reference in New Issue
Block a user