Skip to content

TagSpaces is an offline, open source, document manager with tagging support

adding check by opening of a location

Ilian7586f8c0823c
diff --git a/data/js/directories.ui.js b/data/js/directories.ui.js
index 2fd976b85..0e223f75c 100644
--- a/data/js/directories.ui.js
+++ b/data/js/directories.ui.js
@@ -20,11 +20,16 @@ define(function(require, exports, module) {
console.log("Opening connection in : "+path);
var currentLocation = TSCORE.Config.getLocation(path);
-
- document.title = currentLocation.name + " | " + TSCORE.Config.DefaultSettings.appName;
-
- $( "#locationName" ).text(currentLocation.name).attr("title",path);
-
+ if(currentLocation != undefined) {
+ document.title = currentLocation.name + " | " + TSCORE.Config.DefaultSettings.appName;
+
+ $( "#locationName" ).text(currentLocation.name).attr("title",path);
+
+ // Handle open default perspective for a location
+ var defaultPerspective = currentLocation.perspective;
+ TSCORE.PerspectiveManager.changePerspective(defaultPerspective);
+ }
+
// Clear search query
TSCORE.clearSearchFilter();
@@ -32,10 +37,6 @@ define(function(require, exports, module) {
directoryHistory = [];
navigateToDirectory(path);
- // Handle open default perspective for a location
- var defaultPerspective = currentLocation.perspective;
- TSCORE.PerspectiveManager.changePerspective(defaultPerspective);
-
// Saving the last opened location path in the settings
TSCORE.Config.setLastOpenedLocation(path);
TSCORE.Config.saveSettings();