Skip to content

Commit c1103cd

Browse files
committed
fix: quick link category navigation
1 parent a6ac32f commit c1103cd

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

web-app/js/main.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,4 +878,19 @@ function showToast(message) {
878878
}
879879
})();
880880

881+
// 4. On page load, check for ?category= param and apply filter
882+
(function () {
883+
var params = new URLSearchParams(window.location.search);
884+
var categoryParam = params.get('category');
885+
var validCategories = ['all', 'games', 'math', 'utilities', 'playground', 'favorites'];
886+
if (!categoryParam || !validCategories.includes(categoryParam)) return;
887+
888+
var matchingTab = document.querySelector('[data-category="' + categoryParam + '"]');
889+
if (matchingTab) {
890+
setTimeout(function () {
891+
matchingTab.click();
892+
}, 100);
893+
}
894+
})();
895+
881896
});

0 commit comments

Comments
 (0)