aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/main.ts
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-16 14:07:12 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-16 14:07:12 -0800
commitddbdf506164613cd68194a1406f6855ae9d7f22c (patch)
treed818a9780a9ff33e5232b4fd44165026442ac457 /frontend-vanilla/src/main.ts
parent114259aa929c13122156196f270756b03f9f3e95 (diff)
downloadneko-ddbdf506164613cd68194a1406f6855ae9d7f22c.tar.gz
neko-ddbdf506164613cd68194a1406f6855ae9d7f22c.tar.bz2
neko-ddbdf506164613cd68194a1406f6855ae9d7f22c.zip
v3: fix feed toggle from settings page, add navigation tests
When on the settings page and clicking a feed that was previously active, navigate to that feed instead of toggling back to home. The toggle behavior now only applies when already viewing that feed. Added tests for navigating from settings to feeds and tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend-vanilla/src/main.ts')
-rw-r--r--frontend-vanilla/src/main.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend-vanilla/src/main.ts b/frontend-vanilla/src/main.ts
index 3dc0574..94f5727 100644
--- a/frontend-vanilla/src/main.ts
+++ b/frontend-vanilla/src/main.ts
@@ -128,7 +128,8 @@ export function attachLayoutListeners() {
} else if (navType === 'feed') {
e.preventDefault();
const feedId = link.getAttribute('data-value')!;
- if (store.activeFeedId === parseInt(feedId)) {
+ const currentRoute = router.getCurrentRoute();
+ if (store.activeFeedId === parseInt(feedId) && currentRoute.path !== '/settings') {
router.navigate('/', currentQuery);
} else {
router.navigate(`/feed/${feedId}`, currentQuery);