Skip to content

Commit

Permalink
Fix reading config on location change
Browse files Browse the repository at this point in the history
  • Loading branch information
j-a-n committed Feb 9, 2025
1 parent 6ef1035 commit 9643d1b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions wallpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Released under the GNU General Public License v3.0
*/

const version = "4.39.1";
const version = "4.39.2";
const defaultConfig = {
enabled: false,
enabled_on_tabs: [],
Expand Down Expand Up @@ -602,9 +602,11 @@ function getActiveBrowserModPopup() {
function isActive() {
const params = new URLSearchParams(window.location.search);
if (params.get("edit") == "1") {
console.debug("Edit mode active");
return false;
}
if (!config.enabled) {
console.debug("Wallpanel not enabled in config");
return false;
}
if (
Expand All @@ -613,6 +615,7 @@ function isActive() {
activeTab &&
!config.enabled_on_tabs.includes(activeTab)
) {
console.debug(`Wallpanel not enabled on current tab ${activeTab}`);
return false;
}
if (
Expand All @@ -621,9 +624,11 @@ function isActive() {
getActiveBrowserModPopup() &&
wallpanel.disable_screensaver_on_browser_mod_popup_function(getActiveBrowserModPopup())
) {
console.debug("Browser mod popup function returned true, wallpanel disabled");
return false;
}
if (config.disable_screensaver_on_browser_mod_popup && getActiveBrowserModPopup()) {
console.debug("Browser mod popup active, wallpanel disabled");
return false;
}
return true;
Expand Down Expand Up @@ -3139,6 +3144,7 @@ function reconfigure() {
}

updateConfig();

if (isActive()) {
activateWallpanel();
} else {
Expand Down Expand Up @@ -3184,7 +3190,8 @@ function locationChanged() {
}
activePanel = panel;
activeTab = tab;
reconfigure();

setTimeout(reconfigure, 25);
}

const startTime = Date.now();
Expand Down

0 comments on commit 9643d1b

Please sign in to comment.