fix
This commit is contained in:
parent
8435309769
commit
e28f7e3ec1
|
|
@ -1,26 +1,18 @@
|
||||||
import { TransformResult, transform } from "esbuild";
|
import { TransformResult, transform } from "esbuild";
|
||||||
import { g } from "utils/global";
|
import { g } from "utils/global";
|
||||||
|
import { validate } from "uuid";
|
||||||
import { Doc } from "yjs";
|
import { Doc } from "yjs";
|
||||||
import { MContent } from "../../../../web/src/utils/types/general";
|
import { MContent } from "../../../../web/src/utils/types/general";
|
||||||
import { MItem } from "../../../../web/src/utils/types/item";
|
import { MItem } from "../../../../web/src/utils/types/item";
|
||||||
import { MRoot } from "../../../../web/src/utils/types/root";
|
import { MRoot } from "../../../../web/src/utils/types/root";
|
||||||
import { SAction } from "../actions";
|
import { SAction } from "../actions";
|
||||||
|
import { loadComponent } from "../editor/load-component";
|
||||||
|
import { parseJs } from "../editor/parser/parse-js";
|
||||||
import { docs } from "../entity/docs";
|
import { docs } from "../entity/docs";
|
||||||
import { gunzipAsync } from "../entity/zlib";
|
import { gunzipAsync } from "../entity/zlib";
|
||||||
import { SyncConnection } from "../type";
|
import { SyncConnection } from "../type";
|
||||||
import { parseJs } from "../editor/parser/parse-js";
|
|
||||||
import { snapshot } from "../entity/snapshot";
|
|
||||||
import { validate } from "uuid";
|
|
||||||
import { gzipAsync } from "utils/diff/diff";
|
|
||||||
import { user } from "../entity/user";
|
|
||||||
import { loadComponent } from "../editor/load-component";
|
|
||||||
const decoder = new TextDecoder();
|
const decoder = new TextDecoder();
|
||||||
|
|
||||||
const timeout = {
|
|
||||||
page: {} as Record<string, any>,
|
|
||||||
comp: {} as Record<string, any>,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const code_edit: SAction["code"]["edit"] = async function (
|
export const code_edit: SAction["code"]["edit"] = async function (
|
||||||
this: SyncConnection,
|
this: SyncConnection,
|
||||||
arg
|
arg
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { treeCacheBuild, treeRebuild } from "./tree/build";
|
||||||
import { get, set } from "idb-keyval";
|
import { get, set } from "idb-keyval";
|
||||||
import { nav } from "../../vi/render/script/extract-nav";
|
import { nav } from "../../vi/render/script/extract-nav";
|
||||||
|
|
||||||
const UPDATE_TIMEOUT = 200;
|
const UPDATE_TIMEOUT = 0;
|
||||||
export const edRoute = async (p: PG) => {
|
export const edRoute = async (p: PG) => {
|
||||||
if (p.sync && (p.status === "ready" || p.status === "init")) {
|
if (p.sync && (p.status === "ready" || p.status === "init")) {
|
||||||
if (!p.site.domain && !p.site.name) {
|
if (!p.site.domain && !p.site.name) {
|
||||||
|
|
@ -71,6 +71,7 @@ export const reloadLayout = async (p: PG, layout_id: string, note: string) => {
|
||||||
clearTimeout(page.update_timeout);
|
clearTimeout(page.update_timeout);
|
||||||
page.update_timeout = setTimeout(async () => {
|
page.update_timeout = setTimeout(async () => {
|
||||||
if (origin === "local" || !p.sync) return;
|
if (origin === "local" || !p.sync) return;
|
||||||
|
console.log("page on update snap")
|
||||||
|
|
||||||
const res = await p.sync.yjs.sv_local(
|
const res = await p.sync.yjs.sv_local(
|
||||||
"page",
|
"page",
|
||||||
|
|
@ -184,6 +185,7 @@ export const reloadPage = async (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("page on update", origin)
|
||||||
const res = await p.sync.yjs.sv_local(
|
const res = await p.sync.yjs.sv_local(
|
||||||
"page",
|
"page",
|
||||||
p.page.cur.id,
|
p.page.cur.id,
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ export const EdPropInstanceOptions: FC<{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[local.open]
|
[local.open, mprop, config?.opt]
|
||||||
);
|
);
|
||||||
|
|
||||||
let mode = cprop.meta?.option_mode;
|
let mode = cprop.meta?.option_mode;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue