fix reload
This commit is contained in:
parent
3e5a7ea411
commit
7937a1d772
|
|
@ -28,7 +28,7 @@ export const EdBase = () => {
|
||||||
|
|
||||||
edRoute(p);
|
edRoute(p);
|
||||||
|
|
||||||
if (p.status === "loading") {
|
if (p.status === "post-init") {
|
||||||
return <Loading note={`page-${p.status}`} />;
|
return <Loading note={`page-${p.status}`} />;
|
||||||
}
|
}
|
||||||
if (p.status === "site-not-found" || p.status === "page-not-found") {
|
if (p.status === "site-not-found" || p.status === "page-not-found") {
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,8 @@ export const EDGlobal = {
|
||||||
clients: {} as Record<string, { id: string; username: string }>,
|
clients: {} as Record<string, { id: string; username: string }>,
|
||||||
status: "init" as
|
status: "init" as
|
||||||
| "init"
|
| "init"
|
||||||
| "loading"
|
| "post-init"
|
||||||
|
| "reload"
|
||||||
| "site-not-found"
|
| "site-not-found"
|
||||||
| "page-not-found"
|
| "page-not-found"
|
||||||
| "ready",
|
| "ready",
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { treeRebuild } from "./tree/build";
|
||||||
export const edRoute = async (p: PG) => {
|
export const edRoute = async (p: PG) => {
|
||||||
if (p.status === "ready" || p.status === "init") {
|
if (p.status === "ready" || p.status === "init") {
|
||||||
if (!p.site.domain && !p.site.name) {
|
if (!p.site.domain && !p.site.name) {
|
||||||
p.status = "loading";
|
p.status = "post-init";
|
||||||
const site = await p.sync.site.load(p.site.id);
|
const site = await p.sync.site.load(p.site.id);
|
||||||
if (!site) {
|
if (!site) {
|
||||||
p.status = "site-not-found";
|
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) => {
|
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);
|
const remotePage = await p.sync.page.load(page_id);
|
||||||
|
|
||||||
if (!remotePage) {
|
if (!remotePage) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue