From 6f6ec3b7be100f573e1823173c9130b537a5d395 Mon Sep 17 00:00:00 2001 From: HandyRandyx Date: Fri, 4 Oct 2024 22:03:27 -0300 Subject: [PATCH 1/2] Add popstate event listener to overrideHistoryMethods This ensures 'activeHotCardTypes' is cleared when the user navigates backwards, allowing 'createAndInsertHotCards' to be run when there is the same type of hot card active in two subsequent navigations. --- plugins/hotCards/utils/helpers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/hotCards/utils/helpers.js b/plugins/hotCards/utils/helpers.js index 103cefae..ef0b228b 100644 --- a/plugins/hotCards/utils/helpers.js +++ b/plugins/hotCards/utils/helpers.js @@ -85,6 +85,10 @@ function overrideHistoryMethods(callback) { return result; }; }); + + window.addEventListener("popstate", function () { + callback(); + }); } /** Path Change Listener */ From d7a672f331c45ff07c391754927a775b3798df1d Mon Sep 17 00:00:00 2001 From: HandyRandyx Date: Fri, 4 Oct 2024 22:08:37 -0300 Subject: [PATCH 2/2] Bump version --- plugins/hotCards/hotCards.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hotCards/hotCards.yml b/plugins/hotCards/hotCards.yml index 2da3a651..413f41b9 100644 --- a/plugins/hotCards/hotCards.yml +++ b/plugins/hotCards/hotCards.yml @@ -1,6 +1,6 @@ name: Hot Cards description: Adds custom styling to card elements that match a Tag ID or a Rating Threshold. -version: 1.2.0 +version: 1.2.1 url: https://github.com/stashapp/CommunityScripts/tree/main/plugins/hotCards # requires: CommunityScriptsUILibrary ui: