File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,26 +8,8 @@ const availableLocales = computed(() =>
88 locales .value .map (l => (typeof l === ' string' ? { code: l , name: l } : l )),
99)
1010
11- /**
12- * Check if it's safe to navigate back.
13- * Uses the router's history state to verify there's a previous page in the SPA navigation history.
14- */
15- function canGoBack(): boolean {
16- if (import .meta .server ) return false
17- if (window .history .length <= 1 ) return false
18-
19- // Check if we have a valid position in the history state
20- // This works correctly with client-side SPA navigation (unlike document.referrer)
21- const state = window .history .state as { position? : number } | null
22- return state ?.position != null && state .position > 0
23- }
24-
2511function goBack() {
26- if (canGoBack ()) {
27- router .back ()
28- } else {
29- router .push (' /' )
30- }
12+ router .back ()
3113}
3214
3315onKeyStroke (' Escape' , e => {
You can’t perform that action at this time.
0 commit comments