Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 authored and tom2319273 committed Aug 3, 2024
1 parent 784bda0 commit 256b8df
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/src/editor/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,20 @@ export const openFile = async (options: IOpenFileOptions) => {

/// #if !BROWSER
// https://github.com/siyuan-note/siyuan/issues/7491
let hasMatch = false;
const optionsClone = Object.assign({}, options);
delete optionsClone.app; // 防止 JSON.stringify 时产生递归
hasMatch = await ipcRenderer.invoke(Constants.SIYUAN_GET, {
cmd: Constants.SIYUAN_OPEN_FILE,
options: JSON.stringify(optionsClone),
});
if (hasMatch) {
if (options.afterOpen) {
options.afterOpen();
if (!options.position) {
let hasMatch = false;
const optionsClone = Object.assign({}, options);
delete optionsClone.app; // 防止 JSON.stringify 时产生递归
hasMatch = await ipcRenderer.invoke(Constants.SIYUAN_GET, {
cmd: Constants.SIYUAN_OPEN_FILE,
options: JSON.stringify(optionsClone),
});
if (hasMatch) {
if (options.afterOpen) {
options.afterOpen();
}
return;
}
return;
}
/// #endif

Expand Down

0 comments on commit 256b8df

Please sign in to comment.