From 3fe654a220c1a65c0e8ddf91d5d69beb6abdc793 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 3 Jun 2023 03:17:24 +0200 Subject: [PATCH] fix: svelte didn't work the way i thought it did --- frontend/src/routes/@[username]/+page.svelte | 7 +++---- frontend/src/routes/@[username]/[memberName]/+page.svelte | 7 +++---- frontend/src/routes/edit/member/[id]/+page.svelte | 6 +++--- frontend/src/routes/edit/profile/+page.svelte | 6 +++--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/frontend/src/routes/@[username]/+page.svelte b/frontend/src/routes/@[username]/+page.svelte index 15169a5..5b04ace 100644 --- a/frontend/src/routes/@[username]/+page.svelte +++ b/frontend/src/routes/@[username]/+page.svelte @@ -29,8 +29,7 @@ type FieldEntry, type Pronoun, } from "$lib/api/entities"; - import { PUBLIC_BASE_URL } from "$env/static/public"; - import { env } from "$env/dynamic/public"; + import { PUBLIC_BASE_URL, PUBLIC_SHORT_BASE } from "$env/static/public"; import { apiFetchClient } from "$lib/api/fetch"; import ErrorAlert from "$lib/components/ErrorAlert.svelte"; import { goto } from "$app/navigation"; @@ -120,7 +119,7 @@ }; const copyShortURL = async () => { - const url = `${env.PUBLIC_SHORT_BASE}/${data.sid}`; + const url = `${PUBLIC_SHORT_BASE}/${data.sid}`; await navigator.clipboard.writeText(url); addToast({ body: "Copied the short link to your clipboard!", duration: 2000 }); }; @@ -239,7 +238,7 @@ - {#if env.PUBLIC_SHORT_BASE} + {#if PUBLIC_SHORT_BASE} { - const url = `${env.PUBLIC_SHORT_BASE}/${data.sid}`; + const url = `${PUBLIC_SHORT_BASE}/${data.sid}`; await navigator.clipboard.writeText(url); addToast({ body: "Copied the short link to your clipboard!", duration: 2000 }); }; @@ -161,7 +160,7 @@ - {#if env.PUBLIC_SHORT_BASE} + {#if PUBLIC_SHORT_BASE} { - const url = `${env.PUBLIC_SHORT_BASE}/${data.member.sid}`; + const url = `${PUBLIC_SHORT_BASE}/${data.member.sid}`; await navigator.clipboard.writeText(url); addToast({ body: "Copied the short link to your clipboard!", duration: 2000 }); }; @@ -779,7 +779,7 @@

- {#if env.PUBLIC_SHORT_BASE} + {#if PUBLIC_SHORT_BASE}

Current short ID: {data.member.sid} diff --git a/frontend/src/routes/edit/profile/+page.svelte b/frontend/src/routes/edit/profile/+page.svelte index 8536898..da01fe3 100644 --- a/frontend/src/routes/edit/profile/+page.svelte +++ b/frontend/src/routes/edit/profile/+page.svelte @@ -30,7 +30,7 @@ import { encode } from "base64-arraybuffer"; import { DateTime } from "luxon"; import { apiFetchClient } from "$lib/api/fetch"; - import { env } from "$env/dynamic/public"; + import { PUBLIC_SHORT_BASE } from "$env/static/public"; import IconButton from "$lib/components/IconButton.svelte"; import EditableField from "../EditableField.svelte"; import EditableName from "../EditableName.svelte"; @@ -398,7 +398,7 @@ }; const copyShortURL = async () => { - const url = `${env.PUBLIC_SHORT_BASE}/${data.user.sid}`; + const url = `${PUBLIC_SHORT_BASE}/${data.user.sid}`; await navigator.clipboard.writeText(url); addToast({ body: "Copied the short link to your clipboard!", duration: 2000 }); }; @@ -745,7 +745,7 @@ will be used.

- {#if env.PUBLIC_SHORT_BASE} + {#if PUBLIC_SHORT_BASE}

Current short ID: {data.user.sid}