mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 10:14:21 +01:00
🎨 mobile
This commit is contained in:
parent
17fa7b46d6
commit
e2c6115664
1 changed files with 3 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue