aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(static)
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(static)')
-rw-r--r--src/routes/(static)/+layout.svelte8
-rw-r--r--src/routes/(static)/support/+page.svelte8
2 files changed, 9 insertions, 7 deletions
diff --git a/src/routes/(static)/+layout.svelte b/src/routes/(static)/+layout.svelte
index a0061a19..ff763126 100644
--- a/src/routes/(static)/+layout.svelte
+++ b/src/routes/(static)/+layout.svelte
@@ -1,6 +1,4 @@
<script>
- import { run } from 'svelte/legacy';
-
import Nostr from "$comp/Nostr.svelte";
import { SvelteToast } from "@zerodevx/svelte-toast";
import Footer from "$comp/Footer.svelte";
@@ -8,9 +6,9 @@
import { theme as themeStore } from "$lib/store";
let { data, children } = $props();
- let { theme } = $state(data);
- let { user } = $derived(data);
- run(() => {
+ let user = $derived(data.user);
+ let theme = $state();
+ $effect(() => {
theme = $themeStore;
});
</script>
diff --git a/src/routes/(static)/support/+page.svelte b/src/routes/(static)/support/+page.svelte
index 4cf9706d..1c0aa76d 100644
--- a/src/routes/(static)/support/+page.svelte
+++ b/src/routes/(static)/support/+page.svelte
@@ -8,15 +8,19 @@
import { t } from "$lib/translations";
let { data } = $props();
- let { user } = data;
+ let user = $derived(data.user);
- let username = $state(user?.username);
+ let username = $state();
let email = $state();
let message = $state();
let sent = $state();
let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY;
let isTor = browser && location.hostname.endsWith(".onion");
+ $effect(() => {
+ if (typeof username === "undefined") username = user?.username;
+ });
+
onMount(() => {
if (!isTor && recaptchaSiteKey) {
let s = document.createElement("script");