Skip to content

Commit cb5ba31

Browse files
committed
🐛 Fix lang-toggle.js for live deploy
1 parent 603e8a0 commit cb5ba31

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

guide/theme/lang_toggle.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@
4141
if (idx === -1) {
4242
// Fallback: If "book/" isn’t in the path
4343
// Just go to the top-level file in the chosen language.
44+
let newPath = '';
4445
if (chosenLang === 'en')
45-
window.location.href = 'index.html';
46+
newPath = 'index.html';
4647
else
47-
window.location.href = chosenLang + '/index.html';
48+
newPath = chosenLang + '/index.html';
49+
50+
window.location.href = newPath;
4851

4952
return;
5053
}

0 commit comments

Comments
 (0)