From 6c796d765cbeefe0a515d5c75ea2765b1c8848c8 Mon Sep 17 00:00:00 2001 From: ShivaniKhaire Date: Thu, 1 Oct 2026 16:12:27 +0530 Subject: [PATCH] fix(content): case-insensitive navigation and contract matching for module and template references --- .../content/hooks/use-content-detail-screen.ts | 5 +++-- src/features/content/screens/TemplateScreen.tsx | 4 ++-- src/features/content/utils/content-reference.ts | 12 ++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/features/content/hooks/use-content-detail-screen.ts b/src/features/content/hooks/use-content-detail-screen.ts index 712b4cd..3c5bbda 100644 --- a/src/features/content/hooks/use-content-detail-screen.ts +++ b/src/features/content/hooks/use-content-detail-screen.ts @@ -19,8 +19,9 @@ export function useContentDetailScreen({ ); const moduleMismatch = useMemo(() => { - const contractModuleCode = contractQuery.data?.module_code?.trim(); - return Boolean(contractModuleCode && contractModuleCode !== moduleCode.trim()); + const contractModuleCode = contractQuery.data?.module_code?.trim().toLowerCase(); + const currentModuleCode = moduleCode.trim().toLowerCase(); + return Boolean(contractModuleCode && currentModuleCode && contractModuleCode !== currentModuleCode); }, [contractQuery.data?.module_code, moduleCode]); return { diff --git a/src/features/content/screens/TemplateScreen.tsx b/src/features/content/screens/TemplateScreen.tsx index 604e0fc..45f229d 100644 --- a/src/features/content/screens/TemplateScreen.tsx +++ b/src/features/content/screens/TemplateScreen.tsx @@ -82,7 +82,7 @@ function TemplateScreenResolved({ return ; } - if (contract.template_code !== templateCode) { + if (contract.template_code.toLowerCase() !== templateCode.toLowerCase()) { return (