From 223feede4d2cf5cb7a3079995ca5cb0a01a87f35 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 15 Sep 2025 09:32:39 +0000 Subject: [PATCH] fix: fix navbapp app navigation --- .../(logged)/apps/get/[...path]/+page.svelte | 19 +++++++++++-------- frontend/src/routes/a/[...path]/+page.svelte | 8 ++++---- .../[workspace]/[...secret]/+page.svelte | 8 ++++---- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/frontend/src/routes/(root)/(logged)/apps/get/[...path]/+page.svelte b/frontend/src/routes/(root)/(logged)/apps/get/[...path]/+page.svelte index ac7d1b5b61..2469bdcce9 100644 --- a/frontend/src/routes/(root)/(logged)/apps/get/[...path]/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/apps/get/[...path]/+page.svelte @@ -12,8 +12,9 @@ import { writable } from 'svelte/store' import { twMerge } from 'tailwind-merge' import { page } from '$app/state' - let app: (AppWithLastVersion & { value: any }) | undefined = undefined - let can_write = false + + let app: (AppWithLastVersion & { value: any }) | undefined = $state(undefined) + let can_write = $state(false) async function loadApp() { app = await AppService.getAppLiteByPath({ @@ -23,13 +24,15 @@ can_write = canWrite(app?.path, app?.extra_perms!, $userStore) } - $: if ($workspaceStore && page.params.path) { - if (app && page.params.path === app.path) { - console.log('App already loaded') - } else { - loadApp() + $effect(() => { + if ($workspaceStore && page.params.path) { + if (app && page.params.path === app.path) { + console.log('App already loaded') + } else { + loadApp() + } } - } + }) const breakpoint = writable('lg') diff --git a/frontend/src/routes/a/[...path]/+page.svelte b/frontend/src/routes/a/[...path]/+page.svelte index 1f9a8cc6e3..dd62f71420 100644 --- a/frontend/src/routes/a/[...path]/+page.svelte +++ b/frontend/src/routes/a/[...path]/+page.svelte @@ -22,11 +22,11 @@ import { page } from '$app/state' import { urlParamsToObject } from '$lib/utils' - let app: (AppWithLastVersion & { value: any }) | undefined = undefined - let notExists = false - let noPermission = false + let app: (AppWithLastVersion & { value: any }) | undefined = $state(undefined) + let notExists = $state(false) + let noPermission = $state(false) - let jwtError = false + let jwtError = $state(false) setContext(IS_APP_PUBLIC_CONTEXT_KEY, true) function isJwt(t: string) { diff --git a/frontend/src/routes/public/[workspace]/[...secret]/+page.svelte b/frontend/src/routes/public/[workspace]/[...secret]/+page.svelte index 37455056fc..bdad54f27a 100644 --- a/frontend/src/routes/public/[workspace]/[...secret]/+page.svelte +++ b/frontend/src/routes/public/[workspace]/[...secret]/+page.svelte @@ -23,11 +23,11 @@ import { page } from '$app/state' import { urlParamsToObject } from '$lib/utils' - let app: (AppWithLastVersion & { value: any }) | undefined = undefined - let notExists = false - let noPermission = false + let app: (AppWithLastVersion & { value: any }) | undefined = $state(undefined) + let notExists = $state(false) + let noPermission = $state(false) - let jwtError = false + let jwtError = $state(false) setContext(IS_APP_PUBLIC_CONTEXT_KEY, true) function parseSecret(secret: string): { secret: string; jwt: string } {