mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-10 22:23:28 +08:00
This commit is contained in:
parent
cfbf166e33
commit
3b29cc7bfc
@ -1,13 +1,20 @@
|
||||
import {Constants} from "../constants";
|
||||
/// #if !MOBILE
|
||||
import {Tab} from "./Tab";
|
||||
import {exportLayout} from "./util";
|
||||
/// #endif
|
||||
import {processMessage} from "../util/processMessage";
|
||||
import {kernelError} from "../dialog/processSystem";
|
||||
import {exportLayout} from "./util";
|
||||
|
||||
export class Model {
|
||||
public ws: WebSocket;
|
||||
public reqId: number;
|
||||
/// #if !MOBILE
|
||||
public parent: Tab;
|
||||
/// #else
|
||||
// @ts-ignore
|
||||
public parent: any;
|
||||
/// #endif
|
||||
|
||||
constructor(options: { id: string, type?: TWS, callback?: () => void, msgCallback?: (data: IWebSocketData) => void }) {
|
||||
if (options.msgCallback) {
|
||||
@ -25,7 +32,11 @@ export class Model {
|
||||
const logElement = document.getElementById("errorLog");
|
||||
if (logElement) {
|
||||
// 内核中断后无法 catch fetch 请求错误,重连会导致无法执行 transactionsTimeout
|
||||
/// #if MOBILE
|
||||
window.location.reload();
|
||||
/// #else
|
||||
exportLayout(true);
|
||||
/// #endif
|
||||
}
|
||||
};
|
||||
ws.onmessage = (event) => {
|
||||
|
@ -12,7 +12,7 @@ const closeMenu = (model: Model) => {
|
||||
const leftTabs: Tab[] = [];
|
||||
const rightTabs: Tab[] = [];
|
||||
let midIndex = -1;
|
||||
currentTab.parent.children.forEach((item, index) => {
|
||||
currentTab.parent.children.forEach((item: Tab, index: number) => {
|
||||
const editor = item.model as Editor;
|
||||
if (editor.editor?.protyle && !editor.editor?.protyle.updated) {
|
||||
unmodifiedTabs.push(item);
|
||||
|
Loading…
Reference in New Issue
Block a user