diff --git a/app/web/src/base/page/all.tsx b/app/web/src/base/page/all.tsx index 81235da2..4350ab0d 100644 --- a/app/web/src/base/page/all.tsx +++ b/app/web/src/base/page/all.tsx @@ -8,6 +8,7 @@ import { isLocalhost } from "../../utils/ui/is-localhost"; export default page({ url: "**", component: ({}) => { + const p = useGlobal(EDGlobal, "EDITOR"); useEffect(() => { if (localStorage.getItem("prasi-session")) { diff --git a/app/web/src/index.tsx b/app/web/src/index.tsx index 571e6cc2..1ec2d41c 100644 --- a/app/web/src/index.tsx +++ b/app/web/src/index.tsx @@ -9,6 +9,7 @@ import { registerMobile } from "./render/live/logic/mobile"; import { sworkerAddCache, sworkerRegister } from "./sworker-boot"; import { w } from "./utils/types/general"; + const start = async () => { const base = `${location.protocol}//${location.host}`; let react = { diff --git a/app/web/src/nova/ed/logic/ed-sync.tsx b/app/web/src/nova/ed/logic/ed-sync.tsx index e2f366d9..7c74f372 100644 --- a/app/web/src/nova/ed/logic/ed-sync.tsx +++ b/app/web/src/nova/ed/logic/ed-sync.tsx @@ -100,8 +100,23 @@ export const edInitSync = (p: PG) => { }, select: { id: true, id_site: true }, }) - .then((e) => { - if (e) location.href = `/ed/${e.id_site}/${e.id}`; + .then(async (e) => { + if (e) location.href = `/ed/${params.site_id}/${e.id}`; + else { + const res = await db.page.create({ + data: { + content_tree: { + childs: [], + id: "root", + type: "root", + }, + name: "home", + url: "/", + site: { connect: { id: params.site_id } }, + }, + }); + if (res) location.href = `/ed/${params.site_id}/${res.id}`; + } }); } return false;