Fix search result links to include version in URL - ensures clicking search results navigates to correct Bible translation

This commit is contained in:
Ryderjj89
2025-09-29 10:24:08 -04:00
parent ff68cd3ecb
commit 40ebd7d7e2

View File

@@ -84,7 +84,8 @@ const SearchComponent: React.FC<SearchComponentProps> = ({
const handleResultClick = (result: SearchResult) => { const handleResultClick = (result: SearchResult) => {
const urlBookName = getBookUrlName(formatBookName(result.book)); const urlBookName = getBookUrlName(formatBookName(result.book));
// Navigate to chapter with verse hash to scroll directly to the verse // Navigate to chapter with verse hash to scroll directly to the verse
const url = `/book/${urlBookName}/chapter/${result.chapter}#verse-${result.verse}`; // Include the version in the URL to ensure we navigate to the correct translation
const url = `/version/${selectedVersion}/book/${urlBookName}/chapter/${result.chapter}#verse-${result.verse}`;
navigate(url); navigate(url);
if (onClose) onClose(); if (onClose) onClose();
}; };