Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: fix https://github.com/siyuan-note/siyuan/issues/7723

Vanessa4bc21c493ba1
diff --git a/app/electron/main.js b/app/electron/main.js
index 107bad8fb8..87a189755d 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -57,7 +57,7 @@ const exitApp = (port, errorWindowId) => {
// 关闭端口相同的所有非主窗口
BrowserWindow.getAllWindows().forEach((item) => {
try {
- const currentURL = new URL(item.getURL())
+ const currentURL = new URL(item.getURL());
if (port.toString() === currentURL.port.toString()) {
if (currentURL.href.indexOf("/stage/build/app/?v=") > -1) {
mainWindow = item;
@@ -114,7 +114,7 @@ const exitApp = (port, errorWindowId) => {
globalShortcut.unregisterAll();
writeLog("exited ui");
}
-}
+};
const getServer = (port = kernelPort) => {
return "http://127.0.0.1:" + port;
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts
index f7e86f0cc8..2f321c4761 100644
--- a/app/src/dialog/processSystem.ts
+++ b/app/src/dialog/processSystem.ts
@@ -119,7 +119,7 @@ export const exitSiYuan = () => {
});
};
-export const transactionError = (data: { code: number, data: string }) => {
+export const transactionError = () => {
if (document.getElementById("transactionError")) {
return;
}
diff --git a/app/src/menus/workspace.ts b/app/src/menus/workspace.ts
index 8c77afbdc3..cacc90e224 100644
--- a/app/src/menus/workspace.ts
+++ b/app/src/menus/workspace.ts
@@ -136,14 +136,14 @@ export const workspaceMenu = (rect: DOMRect) => {
showMessage(window.siyuan.languages.duplicate);
return true;
}
- })
+ });
if (hadName) {
return;
}
window.siyuan.storage[Constants.LOCAL_LAYOUTS].push({
name: value,
layout: exportLayout(false, undefined, true)
- })
+ });
setStorageVal(Constants.LOCAL_LAYOUTS, window.siyuan.storage[Constants.LOCAL_LAYOUTS]);
saveDialog.destroy();
});
@@ -169,7 +169,7 @@ export const workspaceMenu = (rect: DOMRect) => {
setStorageVal(Constants.LOCAL_LAYOUTS, window.siyuan.storage[Constants.LOCAL_LAYOUTS]);
return true;
}
- })
+ });
return;
}
fetchPost("/api/system/setUILayout", {layout: item.layout}, () => {
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index ba0c2600c4..fc3039058d 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -959,7 +959,7 @@ export class Toolbar {
const msgId = showMessage(window.siyuan.languages.exporting, 0);
if (renderElement.getAttribute("data-subtype") === "plantuml") {
fetch(renderElement.querySelector("img").getAttribute("src")).then(function (response) {
- return response.blob()
+ return response.blob();
}).then(function (blob) {
const formData = new FormData();
formData.append("file", blob);
diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts
index 54041b6100..aec24a03e5 100644
--- a/app/src/protyle/wysiwyg/keydown.ts
+++ b/app/src/protyle/wysiwyg/keydown.ts
@@ -460,7 +460,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
if ((event.shiftKey && !event.altKey && !isCtrl(event) && (event.key === "Home" || event.key === "End") && isMac()) ||
(event.shiftKey && !event.altKey && isCtrl(event) && (event.key === "Home" || event.key === "End") && !isMac())) {
- const topElement = hasTopClosestByAttribute(nodeElement, "data-node-id", null)
+ const topElement = hasTopClosestByAttribute(nodeElement, "data-node-id", null);
if (topElement) {
topElement.classList.add("protyle-wysiwyg--select");
let nextElement = event.key === "Home" ? topElement.previousElementSibling : topElement.nextElementSibling;
@@ -469,9 +469,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
nextElement = event.key === "Home" ? nextElement.previousElementSibling : nextElement.nextElementSibling;
}
if (event.key === "Home") {
- protyle.wysiwyg.element.firstElementChild.scrollIntoView()
+ protyle.wysiwyg.element.firstElementChild.scrollIntoView();
} else {
- protyle.wysiwyg.element.lastElementChild.scrollIntoView(false)
+ protyle.wysiwyg.element.lastElementChild.scrollIntoView(false);
}
}
event.stopPropagation();
diff --git a/app/src/util/fetch.ts b/app/src/util/fetch.ts
index c21d6ee706..c156129034 100644
--- a/app/src/util/fetch.ts
+++ b/app/src/util/fetch.ts
@@ -1,7 +1,6 @@
import {Constants} from "../constants";
/// #if !BROWSER
import {ipcRenderer} from "electron";
-import {getCurrentWindow} from "@electron/remote";
/// #endif
import {processMessage} from "./processMessage";
import {kernelError} from "../dialog/processSystem";
diff --git a/app/src/util/highlightById.ts b/app/src/util/highlightById.ts
index 44c34811f7..2ef26f613f 100644
--- a/app/src/util/highlightById.ts
+++ b/app/src/util/highlightById.ts
@@ -42,7 +42,7 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
if (!top && getSelection().rangeCount > 0 && hasClosestBlock(getSelection().getRangeAt(0).startContainer)) {
const editorElement = protyle.contentElement;
const cursorTop = getSelectionPosition(editorElement).top - editorElement.getBoundingClientRect().top;
- let top = 0
+ let top = 0;
if (cursorTop < 0) {
top = editorElement.scrollTop + cursorTop;
} else if (cursorTop > editorElement.clientHeight - 74) { // 74 = 移动端底部 + 段落块高度
diff --git a/app/src/util/onGetConfig.ts b/app/src/util/onGetConfig.ts
index d45e8fe0e0..c74032fbfe 100644
--- a/app/src/util/onGetConfig.ts
+++ b/app/src/util/onGetConfig.ts
@@ -150,7 +150,7 @@ export const onGetConfig = (isStart: boolean) => {
try {
JSONToLayout(isStart);
if (window.JSAndroid) {
- window.openFileByURL(window.JSAndroid.getBlockURL())
+ window.openFileByURL(window.JSAndroid.getBlockURL());
}
} catch (e) {
resetLayout();