From 2e1618721f1412a50dbffbca9ecc6982d99cf025 Mon Sep 17 00:00:00 2001 From: Rizky Date: Sat, 27 Jul 2024 14:08:54 +0700 Subject: [PATCH] fix --- app/web/src/nova/ed/logic/comp/load.tsx | 2 ++ app/web/src/nova/ed/logic/ed-route.ts | 9 ++++++++- app/web/src/nova/ed/panel/popup/api/api-db.tsx | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/web/src/nova/ed/logic/comp/load.tsx b/app/web/src/nova/ed/logic/comp/load.tsx index 8dfbbd6e..02971f74 100644 --- a/app/web/src/nova/ed/logic/comp/load.tsx +++ b/app/web/src/nova/ed/logic/comp/load.tsx @@ -86,6 +86,8 @@ export const loadCompSnapshot = async ( if (res) { if (res.sv === res.diff && (res.sv as any) === "not-found") { + console.warn("reload 5"); + //location.reload();(); } diff --git a/app/web/src/nova/ed/logic/ed-route.ts b/app/web/src/nova/ed/logic/ed-route.ts index 338602fd..933f848b 100644 --- a/app/web/src/nova/ed/logic/ed-route.ts +++ b/app/web/src/nova/ed/logic/ed-route.ts @@ -81,6 +81,7 @@ export const reloadLayout = async (p: PG, layout_id: string, note: string) => { if (res) { if (res.sv === res.diff && (res.sv as any) === "not-found") { + console.warn("reload 1"); //location.reload();(); } @@ -185,6 +186,8 @@ export const reloadPage = async ( if (page.page.id !== remotePage.id) { alert("Page ID Mismatch!\n Refreshing to preventing data loss..."); + console.warn("reload 2"); + //location.reload();(); return; } @@ -200,9 +203,11 @@ export const reloadPage = async ( if (res) { if (res.sv === res.diff && (res.sv as any) === "not-found") { + console.warn("reload 3"); + //location.reload();(); } - + const diff_local = Y.encodeStateAsUpdate( doc as any, decompress(res.sv) @@ -248,6 +253,8 @@ export const reloadPage = async ( p.sync.code .action({ type: "flush-page-cache", page_id: page_id }) .then(() => { + console.warn("reload 4"); + //location.reload();(); }); } diff --git a/app/web/src/nova/ed/panel/popup/api/api-db.tsx b/app/web/src/nova/ed/panel/popup/api/api-db.tsx index fd7874ee..f9ae2e06 100644 --- a/app/web/src/nova/ed/panel/popup/api/api-db.tsx +++ b/app/web/src/nova/ed/panel/popup/api/api-db.tsx @@ -92,6 +92,8 @@ export const EdApiDB = ({ localStorage.removeItem(`schema-md-${p.site.id}`); _api.clear_route_cache(p.site.id); + console.warn("reload 6"); + //location.reload();(); }} > @@ -114,6 +116,8 @@ export const EdApiDB = ({ localStorage.removeItem(`schema-md-${p.site.id}`); _api.clear_route_cache(p.site.id); + console.warn("reload 7"); + //location.reload();(); }} > @@ -135,6 +139,8 @@ export const EdApiDB = ({ render(); alert("RESTART: OK"); _api.clear_route_cache(p.site.id); + console.warn("reload 8"); + //location.reload();(); }} >