Skip to content

Commit

Permalink
Fix loadIndexWithFallback failed
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records committed Dec 26, 2024
1 parent 0f75480 commit 5c74bc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ const initPHPSearch = async (language) => {
*/
const loadIndexWithFallback = async () => {
try {
const searchItems = await loadIndex();
return searchItems;
return await loadIndex();
} catch (error) {
if (language !== "en") {
return loadIndexWithFallback("en");
language = "en";
return loadIndexWithFallback();
}
throw error;
}
Expand Down

0 comments on commit 5c74bc3

Please sign in to comment.