diff --git a/app/src/index.ts b/app/src/index.ts index 699a06902..f85a1f984 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -181,7 +181,7 @@ new App(); window.openFileByURL = (openURL) => { if (openURL && isSYProtocol(openURL)) { - const isZoomIn = getSearch("focus", openURL) === "1" + const isZoomIn = getSearch("focus", openURL) === "1"; openFileById({ id: getIdFromSYProtocol(openURL), action: isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT], diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts index 7d29edc90..f6faec384 100644 --- a/app/src/layout/util.ts +++ b/app/src/layout/util.ts @@ -27,7 +27,7 @@ import {saveScroll} from "../protyle/scroll/saveScroll"; import {pdfResize} from "../asset/renderAssets"; import {Backlink} from "./dock/Backlink"; import {openFileById} from "../editor/util"; -import {getSearch, isWindow} from "../util/functions"; +import {isWindow} from "../util/functions"; /// #if !BROWSER import {setTabPosition} from "../window/setHeader"; /// #endif diff --git a/app/src/mobile/util/initFramework.ts b/app/src/mobile/util/initFramework.ts index b442688b2..839c7d0a2 100644 --- a/app/src/mobile/util/initFramework.ts +++ b/app/src/mobile/util/initFramework.ts @@ -16,7 +16,6 @@ import {MobileBacklinks} from "./MobileBacklinks"; import {MobileBookmarks} from "./MobileBookmarks"; import {MobileTags} from "./MobileTags"; import {activeBlur, hideKeyboardToolbar, initKeyboardToolbar} from "./keyboardToolbar"; -import {getSearch} from "../../util/functions"; import {syncGuide} from "../../sync/syncGuide"; export const initFramework = () => { diff --git a/app/src/util/pathName.ts b/app/src/util/pathName.ts index 44991a44f..8ad44070a 100644 --- a/app/src/util/pathName.ts +++ b/app/src/util/pathName.ts @@ -15,13 +15,13 @@ export const getIdZoomInByPath = () => { let isZoomIn = false; if (/^web\+siyuan:\/\/blocks\/\d{14}-\w{7}/.test(PWAURL)) { // PWA 捕获 web+siyuan://blocks/20221031001313-rk7sd0e?focus=1 - id = PWAURL.substring(20, 20 + 22) + id = PWAURL.substring(20, 20 + 22); isZoomIn = getSearch("focus", PWAURL) === "1"; } else if (window.JSAndroid) { // PAD 通过思源协议打开 const SYURL = window.JSAndroid.getBlockURL(); id = getIdFromSYProtocol(SYURL); - isZoomIn = getSearch("focus", SYURL) === "1" + isZoomIn = getSearch("focus", SYURL) === "1"; } else { // 支持通过 URL 查询字符串参数 `id` 和 `focus` 跳转到 Web 端指定块 https://github.com/siyuan-note/siyuan/pull/7086 id = searchParams.get("id"); @@ -29,8 +29,8 @@ export const getIdZoomInByPath = () => { } return { id, isZoomIn - } -} + }; +}; export const isSYProtocol = (url: string) => { return /^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(url); }; diff --git a/app/src/util/serviceWorker.ts b/app/src/util/serviceWorker.ts index 8c59d14fd..2388b25ea 100644 --- a/app/src/util/serviceWorker.ts +++ b/app/src/util/serviceWorker.ts @@ -1,8 +1,8 @@ // https://github.com/siyuan-note/siyuan/pull/8012 export const registerServiceWorker = (scriptURL: string) => { - if (!'serviceWorker' in navigator || typeof (navigator.serviceWorker) === 'undefined' || - !'caches' in window || !'fetch' in window) { - return + if (!"serviceWorker" in navigator || typeof (navigator.serviceWorker) === "undefined" || + !"caches" in window || !"fetch" in window) { + return; } // REF https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration window.navigator.serviceWorker