From 1c702e9e31e9b793ae30e43d24c3e3e5ebebf8e8 Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Thu, 17 Apr 2025 18:39:48 -0700 Subject: [PATCH] Fix card-multiselect js errors on page load when no card multiselect is on page --- theme/static/js/card-multiselect.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theme/static/js/card-multiselect.js b/theme/static/js/card-multiselect.js index a649398..4ac5063 100644 --- a/theme/static/js/card-multiselect.js +++ b/theme/static/js/card-multiselect.js @@ -162,6 +162,10 @@ document.addEventListener('DOMContentLoaded', function() { } }); + if (choicesInstance.getValue(true).length > 0 && window.updateGlobalCardFilters) { + window.updateGlobalCardFilters(); + } + // Listen for increment/decrement clicks (scoped to the choices container). const choicesContainer = selectField.closest('.choices') || document; @@ -212,8 +216,4 @@ document.addEventListener('DOMContentLoaded', function() { } }); }); - - if (choicesInstance.getValue(true).length > 0 && window.updateGlobalCardFilters) { - window.updateGlobalCardFilters(); - } }); \ No newline at end of file