diff --git a/app/src/protyle/wysiwyg/keydown.ts b/app/src/protyle/wysiwyg/keydown.ts index 6b3cae866..6c4ddf437 100644 --- a/app/src/protyle/wysiwyg/keydown.ts +++ b/app/src/protyle/wysiwyg/keydown.ts @@ -38,7 +38,7 @@ import {fontEvent} from "../toolbar/Font"; import {listIndent, listOutdent} from "./list"; import {newFileContentBySelect, rename, replaceFileName} from "../../editor/rename"; import {insertEmptyBlock, jumpToParentNext} from "../../block/util"; -import {getDisplayName, isLocalPath, pathPosix} from "../../util/pathName"; +import {isLocalPath, pathPosix} from "../../util/pathName"; /// #if !MOBILE import {openBy, openFileById} from "../../editor/util"; /// #endif @@ -1058,7 +1058,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { markdown: "" }, response => { insertHTML(`${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}`, protyle); - hideElements(["toolbar"], protyle) + hideElements(["toolbar"], protyle); }); }); } @@ -1082,7 +1082,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => { markdown: "" }, response => { insertHTML(`${escapeHtml(newFileName.substring(0, window.siyuan.config.editor.blockRefDynamicAnchorTextMaxLen))}`, protyle); - hideElements(["toolbar"], protyle) + hideElements(["toolbar"], protyle); }); }); } diff --git a/app/src/search/util.ts b/app/src/search/util.ts index e6aecba4c..49f3a20a7 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -21,13 +21,13 @@ import {hasClosestByClassName} from "../protyle/util/hasClosest"; const saveKeyList = (type: "keys" | "replaceKeys", value: string) => { const searchKeys = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS) || "{}"); - let list: string[] = searchKeys[type] || [] + let list: string[] = searchKeys[type] || []; list.splice(0, 0, value); list = Array.from(new Set(list)); if (list.length > window.siyuan.config.search.limit) { list.splice(window.siyuan.config.search.limit, list.length - window.siyuan.config.search.limit); } - searchKeys[type] = list + searchKeys[type] = list; localStorage.setItem(Constants.LOCAL_SEARCHEKEYS, JSON.stringify(searchKeys)); }; @@ -352,7 +352,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () event.preventDefault(); break; } else if (target.id === "searchHistoryBtn") { - const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}") + const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}"); if (!list.keys || list.keys.length === 0) { return; } @@ -372,7 +372,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () event.preventDefault(); return; } else if (target.id === "replaceHistoryBtn") { - const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}") + const list = JSON.parse(localStorage.getItem(Constants.LOCAL_SEARCHEKEYS)||"{}"); if (!list.replaceKeys || list.replaceKeys.length === 0) { return; } @@ -477,7 +477,7 @@ export const genSearch = (config: ISearchOption, element: Element, closeCB?: () inputTimeout = inputEvent(element, config, inputTimeout, edit, event); }); searchInputElement.addEventListener("blur", () => { - saveKeyList("keys", searchInputElement.value) + saveKeyList("keys", searchInputElement.value); }); searchInputElement.addEventListener("keydown", (event: KeyboardEvent) => { let currentList: HTMLElement = searchPanelElement.querySelector(".b3-list-item--focus"); @@ -985,7 +985,7 @@ const replace = (element: Element, config: ISearchOption, edit: Protyle, isAll: if (!loadElement.classList.contains("fn__none")) { return; } - saveKeyList("replaceKeys", replaceInputElement.value) + saveKeyList("replaceKeys", replaceInputElement.value); let currentList: HTMLElement = searchPanelElement.querySelector(".b3-list-item--focus"); if (!currentList) { return; diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index f4f52f0da..5a1210077 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -1320,7 +1320,7 @@ const panelTreeKeydown = (event: KeyboardEvent) => { tree = (model as Backlink).mTree; } if (!tree) { - return false + return false; } if (event.key === "Enter") { tree.click(activeItemElement);