Browse Source

fix cannot open download directory when file does not exist

MaysWind 5 years ago
parent
commit
eadc29cf46
1 changed files with 6 additions and 1 deletions
  1. 6 1
      app/scripts/services/ariaNgNativeElectronService.js

+ 6 - 1
app/scripts/services/ariaNgNativeElectronService.js

@@ -121,7 +121,12 @@
             },
             openFileInDirectory: function (dir, filename) {
                 var fullpath = localfs.getFullPath(dir, filename);
-                return shell.showItemInFolder && shell.showItemInFolder(fullpath);
+
+                if (localfs.isExists(fullpath)) {
+                    return shell.showItemInFolder && shell.showItemInFolder(fullpath);
+                } else {
+                    return shell.openItem && shell.openItem(dir);
+                }
             },
             onMainWindowMaximize: function (callback) {
                 onMainWindowEvent('maximize', callback);