Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 65dbe6f

Browse files
committed
Merge pull request #1 from googlecodelabs/url
Remove /index on redirect back to home
2 parents 3f7e493 + 7ebf0f6 commit 65dbe6f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

google-codelab.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,13 @@ <h2>Would you like to resume where you left off?</h2>
429429
break;
430430
}
431431
}
432-
if (!index) {
433-
index = '/';
432+
433+
var returnToIndex = index ? decodeURIComponent(index) : index;
434+
if (!returnToIndex || returnToIndex.slice(-6) === '/index') {
435+
returnToIndex = '/';
434436
}
435-
window.location.href = decodeURIComponent(index);
437+
438+
window.location.href = returnToIndex;
436439
},
437440

438441
_tocItemClass: function(selected, i) {

0 commit comments

Comments
 (0)