Skip to content

Commit

Permalink
transition key rename
Browse files Browse the repository at this point in the history
  • Loading branch information
andre-brandao committed Aug 7, 2024
1 parent eb3d4d3 commit 44479e5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/routes/(auth)/signup/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const actions: Actions = {
} catch (e) {
if (e instanceof LibsqlError && e.code === 'SQLITE_CONSTRAINT_UNIQUE') {
return fail(400, {
message: 'Username already used',
message: 'Username or Email already used',
})
}
console.error(e)
Expand Down
2 changes: 1 addition & 1 deletion src/routes/+layout.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import type { LayoutServerLoad } from './$types'

export const load = (async ({ locals, url }) => {
const { session, user } = locals
return { session, user, url: url.pathname }
return { session, user, transition_key: url.pathname }
}) satisfies LayoutServerLoad
2 changes: 1 addition & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<!-- <DrawerContainer> -->
<NavBar>
<ModalContainer />
<Transition {data}>
<Transition key={data.transition_key}>
<slot />
</Transition>
</NavBar>
Expand Down
4 changes: 2 additions & 2 deletions src/routes/Transition.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { onNavigate } from '$app/navigation'
import PreLoadingIndicator from './PreLoadingIndicator.svelte'
export let data
export let key
onNavigate(navigation => {
// @ts-expect-error
Expand All @@ -24,7 +24,7 @@
<!-- TODO: fix duplicating page bug -->
<!-- or $navigating -->
{#key data.url}
{#key key}
<div
in:fly={{
duration: 300,
Expand Down

0 comments on commit 44479e5

Please sign in to comment.