Skip to content

Commit

Permalink
Fixed the page change detection
Browse files Browse the repository at this point in the history
  • Loading branch information
S3L3CT3DLoves committed Feb 26, 2024
1 parent ae7608d commit caa67ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/QuickEdit/easytag.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const patternScenes = new URLPattern({ pathname: '/scenes/*' });

/** Main UI of the plugin */
class PluginUI {
Expand Down Expand Up @@ -234,7 +235,7 @@ class PluginUI {

/** Called when page changes to verify if the plugin must be displayed */
function checkDisplay(){
const patternScenes = new URLPattern({ pathname: '/scenes/*' });
console.log("Page Change");
main(patternScenes.test(window.location.href))
}

Expand All @@ -250,7 +251,6 @@ const observeUrlChange = () => {
});
observer.observe(body, { childList: true, subtree: true });
};
window.addEventListener("popstate", observeUrlChange)


const btnConfig = new ButtonsConfig()
Expand Down Expand Up @@ -289,7 +289,9 @@ async function main(display){
}
}

// Init the plugin & page change listener
checkDisplay()
observeUrlChange()



Expand Down

0 comments on commit caa67ed

Please sign in to comment.