From 7937a1d772ce4ec560be614f0e6ac9879da551a5 Mon Sep 17 00:00:00 2001 From: Rizky Date: Thu, 18 Jan 2024 16:04:42 +0800 Subject: [PATCH] fix reload --- app/web/src/nova/ed/ed-base.tsx | 2 +- app/web/src/nova/ed/logic/ed-global.ts | 3 ++- app/web/src/nova/ed/logic/ed-route.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/web/src/nova/ed/ed-base.tsx b/app/web/src/nova/ed/ed-base.tsx index ce9d8b81..b7e61c00 100644 --- a/app/web/src/nova/ed/ed-base.tsx +++ b/app/web/src/nova/ed/ed-base.tsx @@ -28,7 +28,7 @@ export const EdBase = () => { edRoute(p); - if (p.status === "loading") { + if (p.status === "post-init") { return ; } if (p.status === "site-not-found" || p.status === "page-not-found") { diff --git a/app/web/src/nova/ed/logic/ed-global.ts b/app/web/src/nova/ed/logic/ed-global.ts index 76c4de9d..263786af 100644 --- a/app/web/src/nova/ed/logic/ed-global.ts +++ b/app/web/src/nova/ed/logic/ed-global.ts @@ -123,7 +123,8 @@ export const EDGlobal = { clients: {} as Record, status: "init" as | "init" - | "loading" + | "post-init" + | "reload" | "site-not-found" | "page-not-found" | "ready", diff --git a/app/web/src/nova/ed/logic/ed-route.ts b/app/web/src/nova/ed/logic/ed-route.ts index b614a0fb..5a138d84 100644 --- a/app/web/src/nova/ed/logic/ed-route.ts +++ b/app/web/src/nova/ed/logic/ed-route.ts @@ -8,7 +8,7 @@ import { treeRebuild } from "./tree/build"; export const edRoute = async (p: PG) => { if (p.status === "ready" || p.status === "init") { if (!p.site.domain && !p.site.name) { - p.status = "loading"; + p.status = "post-init"; const site = await p.sync.site.load(p.site.id); if (!site) { p.status = "site-not-found"; @@ -39,7 +39,7 @@ export const edRoute = async (p: PG) => { }; export const reloadPage = async (p: PG, page_id: string, note: string) => { - p.status = "loading"; + p.status = "reload"; const remotePage = await p.sync.page.load(page_id); if (!remotePage) {