diff --git a/app/electron/main.js b/app/electron/main.js index ea8625686..32eabf2a8 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -61,10 +61,10 @@ const exitApp = (port, errorWindowId) => { if (port.toString() === currentURL.port.toString()) { const hasMain = workspaces.find((workspaceItem) => { if (workspaceItem.browserWindow.id === item.id) { - mainWindow = item + mainWindow = item; return true; } - }) + }); if (!hasMain) { item.destroy(); } diff --git a/app/src/editor/util.ts b/app/src/editor/util.ts index 0ba6023b5..b4ac3a577 100644 --- a/app/src/editor/util.ts +++ b/app/src/editor/util.ts @@ -118,7 +118,7 @@ const openFile = (options: IOpenFileOptions) => { /// #if !BROWSER // https://github.com/siyuan-note/siyuan/issues/7491 BrowserWindow.getAllWindows().find((item) => { - const json = getSearch("json", new URL(item.webContents.getURL()).search) + const json = getSearch("json", new URL(item.webContents.getURL()).search); if (json) { const jsonObj = JSON.parse(json); if ((jsonObj.children.rootId && jsonObj.children.rootId === options.rootID) || diff --git a/app/src/mobile/settings/appearance.ts b/app/src/mobile/settings/appearance.ts index 4db34ac55..f400c11cd 100644 --- a/app/src/mobile/settings/appearance.ts +++ b/app/src/mobile/settings/appearance.ts @@ -1,4 +1,3 @@ -import {closePanel} from "../util/closePanel"; import {fetchPost} from "../../util/fetch"; import {setInlineStyle} from "../../util/assets"; import {genOptions} from "../../util/genOptions"; diff --git a/app/src/protyle/header/Background.ts b/app/src/protyle/header/Background.ts index 89fdf7dae..d64b24be8 100644 --- a/app/src/protyle/header/Background.ts +++ b/app/src/protyle/header/Background.ts @@ -353,7 +353,7 @@ export class Background { this.element.setAttribute("data-node-id", rootId); if (tags) { let html = ""; - const colors = ['secondary', "primary", "info", "success", "warning", "error", ""]; + const colors = ["secondary", "primary", "info", "success", "warning", "error", ""]; tags.split(",").forEach((item, index) => { html += `
${item}
`; }); diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 789203ea4..bf193b7eb 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -10,7 +10,7 @@ import { } from "../util/selection"; import { hasClosestBlock, - hasClosestByAttribute, hasClosestByClassName, + hasClosestByAttribute, hasClosestByMatchTag, hasTopClosestByAttribute } from "../util/hasClosest"; @@ -1007,7 +1007,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { selectElement.push(item); }); if (selectElement.length === 0) { - selectElement.push(nodeElement) + selectElement.push(nodeElement); } quickMakeCard(selectElement); event.preventDefault(); diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 3401a5214..f37dfb62a 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -5,7 +5,7 @@ import {Search} from "./index"; import {Wnd} from "../layout/Wnd"; import {Constants} from "../constants"; import {escapeAttr, escapeGreat, escapeHtml} from "../util/escape"; -import {fetchPost, fetchSyncPost} from "../util/fetch"; +import {fetchPost} from "../util/fetch"; import {openFileById} from "../editor/util"; import {showMessage} from "../dialog/message"; import {reloadProtyle} from "../protyle/util/reload"; @@ -22,19 +22,19 @@ import {setStorageVal} from "../protyle/util/compatibility"; const appendCriteria = (element: HTMLElement, data: ISearchOption[]) => { fetchPost("/api/storage/getCriteria", {}, (response) => { - let html = ''; + let html = ""; response.data.forEach((item: ISearchOption, index: number) => { data.push(item); - html += `
${escapeHtml(item.name)}
` - }) + html += `
${escapeHtml(item.name)}
`; + }); element.innerHTML = html; if (html === "") { - element.classList.add("fn__none") + element.classList.add("fn__none"); } else { - element.classList.remove("fn__none") + element.classList.remove("fn__none"); } }); -} +}; const saveKeyList = (type: "keys" | "replaceKeys", value: string) => { let list: string[] = window.siyuan.storage[Constants.LOCAL_SEARCHKEYS][type]; @@ -193,7 +193,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: ()
`; - const criteriaData: ISearchOption[] = [] + const criteriaData: ISearchOption[] = []; appendCriteria(element.querySelector("#criteria"), criteriaData); const searchPanelElement = element.querySelector("#searchList"); const searchInputElement = element.querySelector("#searchInput") as HTMLInputElement; @@ -293,19 +293,19 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () updateConfig(element, item, config, edit); return true; } - }) + }); event.stopPropagation(); event.preventDefault(); break; } else if (target.classList.contains("b3-chip__close") && target.getAttribute("data-type") === "remove-criteria") { - const name = target.parentElement.innerText.trim() + const name = target.parentElement.innerText.trim(); fetchPost("/api/storage/removeCriterion", {name}); criteriaData.find((item, index) => { if (item.name === name) { criteriaData.splice(index, 1); return true; } - }) + }); if (target.parentElement.parentElement.childElementCount === 1) { target.parentElement.parentElement.classList.add("fn__none"); target.parentElement.remove(); @@ -871,9 +871,9 @@ const addConfigMoreMenu = async (config: ISearchOption, edit: Protyle, element: criteriaData.push(Object.assign({}, criterion)); fetchPost("/api/storage/setCriterion", {criterion}, () => { saveDialog.destroy(); - const criteriaElement = element.querySelector("#criteria") + const criteriaElement = element.querySelector("#criteria"); criteriaElement.classList.remove("fn__none"); - criteriaElement.insertAdjacentHTML("beforeend", `
${criterion.name}
`) + criteriaElement.insertAdjacentHTML("beforeend", `
${criterion.name}
`); }); }); } @@ -926,7 +926,7 @@ const updateConfig = (element: Element, item: ISearchOption, config: ISearchOpti element.querySelector("#replaceHistoryBtn").parentElement.classList.add("fn__none"); } } - const searchPathInputElement = element.querySelector("#searchPathInput") + const searchPathInputElement = element.querySelector("#searchPathInput"); if (item.hPath) { searchPathInputElement.innerHTML = `${escapeHtml(item.hPath)}`; searchPathInputElement.setAttribute("title", item.hPath);