-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update to svelte 5, improve some backend errors (#129)
- Loading branch information
1 parent
0920cf3
commit afba584
Showing
41 changed files
with
484 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const auth: { unauthenticated: boolean } = $state({ | ||
unauthenticated: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
<script lang="ts"> | ||
import { useAuth } from '$lib/auth-context'; | ||
import PageReauthenticateState from './page-states/PageReauthenticateState.svelte'; | ||
import type { Snippet } from 'svelte'; | ||
import { auth } from '$lib/auth.svelte'; | ||
const auth = useAuth(); | ||
type Props = { | ||
children: Snippet; | ||
}; | ||
let { children }: Props = $props(); | ||
</script> | ||
|
||
{#if $auth.unauthenticated} | ||
{#if auth.unauthenticated} | ||
<PageReauthenticateState /> | ||
{:else} | ||
<slot /> | ||
{@render children?.()} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
<script lang="ts"> | ||
import { useAuth } from '$lib/auth-context'; | ||
import { auth } from '$lib/auth.svelte'; | ||
import type { MaybeError } from '$lib/types/error'; | ||
import { onMount } from 'svelte'; | ||
import { onMount, type Snippet } from 'svelte'; | ||
export let error: MaybeError; | ||
type Props = { | ||
error: MaybeError; | ||
children?: Snippet; | ||
}; | ||
const auth = useAuth(); | ||
const { error, children }: Props = $props(); | ||
onMount(() => { | ||
console.error('streamed error: ', error); | ||
if (error?.status === 401) { | ||
$auth.unauthenticated = true; | ||
auth.unauthenticated = true; | ||
} | ||
}); | ||
</script> | ||
|
||
<slot /> | ||
{@render children?.()} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.