Skip to content

Commit

Permalink
Migrated to Sveltekit page state.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Dec 23, 2024
1 parent eeab262 commit c566fb5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 47 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http:

- Added ability to change user interface font to one of the supported fonts.
- Fixed #604, adding a project chat feature to enable communication between project collaborators and gallery owners.
- Migrated to Sveltekit page state.

## 0.13.2 2024-12-09

Expand Down
80 changes: 38 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"svelte-jester": "^5",
"svelte-preprocess": "^6.0",
"@sveltejs/adapter-static": "^3",
"@sveltejs/kit": "^2",
"@sveltejs/kit": "^2.12.0",
"@sveltejs/vite-plugin-svelte": "^5",
"@types/matter-js": "^0",
"@types/node": "^22",
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/Link.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { page } from '$app/state';
interface Props {
to: string;
Expand All @@ -18,7 +18,7 @@
}: Props = $props();
</script>

{#if to === '/' ? $page.route.id === '/' : $page.route.id?.startsWith(to)}
{#if to === '/' ? page.route.id === '/' : page.route.id?.startsWith(to)}
{@render children?.()}
{:else}<a
data-sveltekit-preload-data="tap"
Expand Down
5 changes: 3 additions & 2 deletions src/components/app/ProjectPreview.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<!-- @migration task: review uses of `navigating` -->
<script lang="ts">
import type Project from '@models/Project';
import Evaluator from '@runtime/Evaluator';
import { Chats, DB, locales } from '../../db/Database';
import { isAudience, isFlagged } from '../../models/Moderation';
import { getUser } from '../project/Contexts';
import Link from './Link.svelte';
import { navigating } from '$app/stores';
import { navigating } from '$app/state';
import Spinning from './Spinning.svelte';
import { toStage } from '@output/Stage';
import { EXCEPTION_SYMBOL, PHRASE_SYMBOL } from '@parser/Symbols';
Expand Down Expand Up @@ -135,7 +136,7 @@
>&mdash;</em
>{:else}
{project.getName()}{/if}</Link
>{#if $navigating && `${$navigating.to?.url.pathname}${$navigating.to?.url.search}` === path}
>{#if navigating && `${navigating.to?.url.pathname}${navigating.to?.url.search}` === path}
<Spinning />{:else}{@render children?.()}{/if}{/if}
{#if unread}<div class="notification">{PHRASE_SYMBOL}</div
>{/if}</div
Expand Down

0 comments on commit c566fb5

Please sign in to comment.