mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 08:38:18 +00:00
fix compatibilies with electron9 for plugins
This commit is contained in:
@@ -405,7 +405,7 @@ define(function() {
|
||||
|
||||
getTargetPath: function(callback) {
|
||||
// showSaveDialog 不支持property选择文件夹
|
||||
Api.gui.dialog.showOpenDialog(Api.gui.getCurrentWindow(),
|
||||
var po = Api.gui.dialog.showOpenDialog(Api.gui.getCurrentWindow(),
|
||||
{
|
||||
defaultPath: Api.gui.app.getPath('userDesktop') + '/',
|
||||
properties: ['openDirectory']
|
||||
@@ -414,6 +414,21 @@ define(function() {
|
||||
callback(targetPath);
|
||||
}
|
||||
);
|
||||
|
||||
if(typeof(po) != "object"){
|
||||
return;
|
||||
}
|
||||
|
||||
po.then(function(re){
|
||||
if(re.canceled !== false || re.filePaths.length < 1){
|
||||
return;
|
||||
}
|
||||
callback(re.filePaths[0]);
|
||||
},
|
||||
function(err){
|
||||
alert(err);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
loadingIsClosed: false,
|
||||
|
Reference in New Issue
Block a user