fix: fix navbapp app navigation
This commit is contained in:
@@ -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<EditorBreakpoint>('lg')
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 } {
|
||||
|
||||
Reference in New Issue
Block a user