Skip to content

Commit 4be7dac

Browse files
Migrate to $app/state
1 parent 58674b7 commit 4be7dac

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib/components/renderers/BodyRenderer.svelte

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import type { Snippet } from "svelte";
3-
import { page } from "$app/stores";
3+
import { page } from "$app/state";
44
55
type Props = {
66
children?: Snippet;
@@ -9,9 +9,6 @@
99
let { children }: Props = $props();
1010
let data = $state<HTMLParagraphElement>();
1111
12-
const org = $page.data.org;
13-
const repo = $page.data.repo;
14-
1512
$effect(() => {
1613
if (!data) return;
1714
let replaced = data.innerHTML;
@@ -22,7 +19,7 @@
2219
if (!wholeMatch || !matchedGroup) continue;
2320
replaced = replaced.replace(
2421
wholeMatch,
25-
` <a href="https://github.com/${org}/${repo}/issues/${matchedGroup}">${wholeMatch.trim()}</a>`
22+
` <a href="https://github.com/${page.data.org}/${page.data.repo}/issues/${matchedGroup}">${wholeMatch.trim()}</a>`
2623
);
2724
}
2825
data.innerHTML = replaced;

src/routes/+layout.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { fade } from "svelte/transition";
66
import { dev } from "$app/environment";
77
import { env } from "$env/dynamic/public";
8-
import { page } from "$app/stores";
8+
import { page } from "$app/state";
99
import { ChevronDown, LoaderCircle, LogOut, Monitor, Moon, Sun, X } from "lucide-svelte";
1010
import { ModeWatcher, resetMode, setMode } from "mode-watcher";
1111
import { Octokit } from "octokit";
@@ -152,7 +152,7 @@
152152

153153
<!-- Navigation -->
154154
<!-- TODO: don't hardcode scrollY? -->
155-
{#if scrollY > 150 && $page.route.id === "/"}
155+
{#if scrollY > 150 && page.route.id === "/"}
156156
<ul transition:fade={{ duration: 200 }} class="ml-6 hidden sm:block">
157157
<li>
158158
{#each typedEntries(data.repos) as [id, { name }]}

0 commit comments

Comments
 (0)