fix breaking change in shell.openItem

https://github.com/electron/electron/pull/20682
This commit is contained in:
Labhansh Agrawal 2020-05-29 10:31:49 +05:30 committed by Benjamin Staneck
parent 2a78d13e93
commit a1b92dea3f

View file

@ -71,7 +71,7 @@ export default () => {
return hasDefaultSet()
.then((yes) => {
if (yes) {
return shell.openItem(cfgPath);
return shell.openPath(cfgPath).then((error) => error === '');
}
console.warn('No default app set for .js files, using notepad.exe fallback');
return openNotepad(cfgPath);
@ -81,6 +81,6 @@ export default () => {
return openNotepad(cfgPath);
});
} else {
return Promise.resolve(shell.openItem(cfgPath));
return Promise.resolve(shell.openPath(cfgPath).then((error) => error === ''));
}
};