@@ -11,7 +11,7 @@ import {
1111import { Model } from "../layout/Model" ;
1212import "../assets/scss/mobile.scss" ;
1313import { Menus } from "../menus" ;
14- import { addBaseURL , getIdFromSYProtocol , isSYProtocol , setNoteBook } from "../util/pathName" ;
14+ import { addBaseURL , parseSiYuanUriInfo , setNoteBook } from "../util/pathName" ;
1515import { handleTouchEnd , handleTouchMove , handleTouchStart } from "./util/touch" ;
1616import { fetchGet , fetchPost } from "../util/fetch" ;
1717import { initFramework } from "./util/initFramework" ;
@@ -22,7 +22,6 @@ import {goBack} from "./util/MobileBackFoward";
2222import { activeBlur , hideKeyboardToolbar , showKeyboardToolbar } from "./util/keyboardToolbar" ;
2323import { getLocalStorage , isChromeBrowser , isInMobileApp , writeText } from "../protyle/util/compatibility" ;
2424import { getCurrentEditor , openMobileFileById } from "./editor" ;
25- import { getSearch } from "../util/functions" ;
2625import { checkPublishServiceClosed } from "../util/processMessage" ;
2726import { initRightMenu } from "./menu" ;
2827import { openChangelog } from "../boot/openChangelog" ;
@@ -244,9 +243,10 @@ window.processIOSPurchaseResponse = processIOSPurchaseResponse;
244243window . showKeyboardToolbar = showKeyboardToolbar ;
245244window . hideKeyboardToolbar = hideKeyboardToolbar ;
246245window . openFileByURL = ( openURL ) => {
247- if ( openURL && isSYProtocol ( openURL ) ) {
248- openMobileFileById ( siyuanApp , getIdFromSYProtocol ( openURL ) ,
249- getSearch ( "focus" , openURL ) === "1" ? [ Constants . CB_GET_ALL ] : [ Constants . CB_GET_HL , Constants . CB_GET_CONTEXT , Constants . CB_GET_ROOTSCROLL ] ) ;
246+ const blockInfo = parseSiYuanUriInfo ( openURL ) ;
247+ if ( blockInfo != null ) {
248+ openMobileFileById ( siyuanApp , blockInfo . id ,
249+ blockInfo . focus ? [ Constants . CB_GET_ALL ] : [ Constants . CB_GET_HL , Constants . CB_GET_CONTEXT , Constants . CB_GET_ROOTSCROLL ] ) ;
250250 return true ;
251251 }
252252 return false ;
0 commit comments