mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user