Skip to content

Commit e1f6104

Browse files
committed
fix app back button on empty history
1 parent 2757c38 commit e1f6104

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/routes/AppHeader.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@
3636
<!-- svelte-ignore a11y_consider_explicit_label -->
3737
<button
3838
on:click={canGoBack
39-
? () => window.history.back()
40-
: () => goto("/app/home")}
39+
? () =>
40+
window.history.length > 1
41+
? window.history.back()
42+
: goto("/app/home")
43+
: undefined}
4144
class:opacity-0={!canGoBack}
4245
class="-m-4 p-4"
4346
>

0 commit comments

Comments
 (0)