fix reconnecting...
This commit is contained in:
parent
6b5b8526ee
commit
309d616afe
|
|
@ -1,17 +1,17 @@
|
||||||
|
import { createRouter, RadixRouter } from "radix3";
|
||||||
import { compress, decompress } from "wasm-gzip";
|
import { compress, decompress } from "wasm-gzip";
|
||||||
import { deepClone } from "web-utils";
|
import { deepClone } from "web-utils";
|
||||||
import * as Y from "yjs";
|
import * as Y from "yjs";
|
||||||
|
import { registerSiteTypings } from "../../../utils/script/typings";
|
||||||
import { clientStartSync } from "../../../utils/sync/ws-client";
|
import { clientStartSync } from "../../../utils/sync/ws-client";
|
||||||
import { w } from "../../../utils/types/general";
|
import { w } from "../../../utils/types/general";
|
||||||
import { Loading } from "../../../utils/ui/loading";
|
import { Loading } from "../../../utils/ui/loading";
|
||||||
|
import { loadFrontEnd, loadTypings } from "./code-loader";
|
||||||
|
import { updateComponentMeta } from "./comp/load";
|
||||||
import { EmptySite, PG } from "./ed-global";
|
import { EmptySite, PG } from "./ed-global";
|
||||||
import { treeRebuild } from "./tree/build";
|
|
||||||
import { reloadPage } from "./ed-route";
|
import { reloadPage } from "./ed-route";
|
||||||
import { loadSite } from "./ed-site";
|
import { loadSite } from "./ed-site";
|
||||||
import { updateComponentMeta } from "./comp/load";
|
import { treeRebuild } from "./tree/build";
|
||||||
import { createRouter, RadixRouter } from "radix3";
|
|
||||||
import { loadCode, loadFrontEnd, loadTypings } from "./code-loader";
|
|
||||||
import { registerSiteTypings } from "../../../utils/script/typings";
|
|
||||||
|
|
||||||
const decoder = new TextDecoder();
|
const decoder = new TextDecoder();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,13 @@ const connect = (
|
||||||
`${url.protocol}//${url.host}${url.pathname}`
|
`${url.protocol}//${url.host}${url.pathname}`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const timeout = setTimeout(() => {
|
||||||
|
ws.close();
|
||||||
|
retry();
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
ws.onopen = () => {
|
ws.onopen = () => {
|
||||||
|
clearTimeout(timeout);
|
||||||
w.offline = false;
|
w.offline = false;
|
||||||
w.editorRender?.();
|
w.editorRender?.();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue