wip fix
This commit is contained in:
parent
a2a73ed6e6
commit
5a745a7b9a
File diff suppressed because one or more lines are too long
|
|
@ -1,5 +1,5 @@
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import { GlobalContext } from "web-utils";
|
import { GlobalContext, useLocal } from "web-utils";
|
||||||
import { DeadEnd } from "../../utils/ui/deadend";
|
import { DeadEnd } from "../../utils/ui/deadend";
|
||||||
import { Loading } from "../../utils/ui/loading";
|
import { Loading } from "../../utils/ui/loading";
|
||||||
import { evalCJS } from "../ed/logic/ed-sync";
|
import { evalCJS } from "../ed/logic/ed-sync";
|
||||||
|
|
@ -13,6 +13,7 @@ import { w } from "./w";
|
||||||
|
|
||||||
export const Root = () => {
|
export const Root = () => {
|
||||||
// #region context
|
// #region context
|
||||||
|
const local = useLocal({ page_id: "" });
|
||||||
const [_, set] = useState({});
|
const [_, set] = useState({});
|
||||||
const render = () => set({});
|
const render = () => set({});
|
||||||
w.prasiContext.render = render;
|
w.prasiContext.render = render;
|
||||||
|
|
@ -55,6 +56,10 @@ export const Root = () => {
|
||||||
const page = router.lookup(base.pathname);
|
const page = router.lookup(base.pathname);
|
||||||
if (!page) return <DeadEnd>Page Not Found</DeadEnd>;
|
if (!page) return <DeadEnd>Page Not Found</DeadEnd>;
|
||||||
|
|
||||||
|
if (page.id !== local.page_id) {
|
||||||
|
base.init_local_effect = {};
|
||||||
|
}
|
||||||
|
|
||||||
w.params = page.params || {};
|
w.params = page.params || {};
|
||||||
|
|
||||||
base.page.id = page.id;
|
base.page.id = page.id;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ export const createViLocal = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let should_run = !init_local_effect[id];
|
let should_run = !init_local_effect[id];
|
||||||
if (should_run) {
|
if (should_run) {
|
||||||
if (typeof init_local_effect === "object") {
|
if (typeof init_local_effect === "object") {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue