This commit is contained in:
parent
974f1c1183
commit
58efcd588d
1 changed files with 13 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue