From e2c6115664b3b15b74e7c806a5cf14581d19f336 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 3 Jun 2023 11:13:35 +0800 Subject: [PATCH] :art: mobile --- app/src/layout/Model.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/layout/Model.ts b/app/src/layout/Model.ts index 43d97d045..0d29f8c74 100644 --- a/app/src/layout/Model.ts +++ b/app/src/layout/Model.ts @@ -39,6 +39,7 @@ export class Model { const websocketURL = `${window.location.protocol === "https:" ? "wss" : "ws"}://${window.location.host}/ws`; const ws = new WebSocket(`${websocketURL}?app=${Constants.SIYUAN_APPID}&id=${options.id}${options.type ? "&type=" + options.type : ""}`); ws.onopen = () => { + alert("onopen") if (options.callback) { options.callback.call(this); } @@ -61,7 +62,7 @@ export class Model { } }; ws.onclose = (ev) => { - console.error("ws.onclose", ev) + alert(ev.reason) if (0 <= ev.reason.indexOf("unauthenticated")) { return; } @@ -78,7 +79,7 @@ export class Model { } }; ws.onerror = (err: Event & { target: { url: string, readyState: number } }) => { - console.error("ws.onerror", err) + alert("onerror") if (err.target.url.endsWith("&type=main") && err.target.readyState === 3) { kernelError(); }