From 967339a400965c5b71fb65143e280905a3d08998 Mon Sep 17 00:00:00 2001 From: Yared Yemane Date: Tue, 14 Apr 2026 09:10:00 -0700 Subject: [PATCH] load human language data on tab route activation Trigger hierarchy fetch whenever the Human Language route is selected so data appears immediately when switching tabs from Content Management. Made-with: Cursor --- src/pages/content-management/HumanLanguagePage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/content-management/HumanLanguagePage.tsx b/src/pages/content-management/HumanLanguagePage.tsx index 5db4aff..057d735 100644 --- a/src/pages/content-management/HumanLanguagePage.tsx +++ b/src/pages/content-management/HumanLanguagePage.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useState, type ChangeEvent } from "react" -import { Link, useNavigate } from "react-router-dom" +import { Link, useLocation, useNavigate } from "react-router-dom" import { ChevronDown, ChevronRight, @@ -335,6 +335,7 @@ function nextMissingPositive(values: number[]): number { export function HumanLanguagePage() { const navigate = useNavigate() + const location = useLocation() const [loading, setLoading] = useState(false) const [categoryId, setCategoryId] = useState(null) const [subCategories, setSubCategories] = useState([]) @@ -444,6 +445,7 @@ export function HumanLanguagePage() { } useEffect(() => { + if (!location.pathname.startsWith("/content/human-language")) return let cancelled = false const run = async () => { setLoading(true) @@ -478,7 +480,7 @@ export function HumanLanguagePage() { return () => { cancelled = true } - }, []) + }, [location.pathname, location.key]) useEffect(() => { const save = () => sessionStorage.setItem(HUMAN_LANGUAGE_SCROLL_KEY, String(window.scrollY || 0))