Skip to content

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

added getCurrentLocationPath selector

Ilian Sapundshiev27f141fa9052
diff --git a/app/reducers/app.js b/app/reducers/app.js
index d9febb169..f42509f40 100644
--- a/app/reducers/app.js
+++ b/app/reducers/app.js
@@ -1355,16 +1355,18 @@ export const getDirectoryContent = (state: Object) =>
state.app.currentDirectoryEntries;
export const getDirectoryPath = (state: Object) =>
state.app.currentDirectoryPath;
-/* export const getPathCurrentLocation = (state: Object) => {
+export const getCurrentLocationPath = (state: Object) => {
let pathCurrentLocation;
- state.locations.map((location) => {
- if (state.app.currentLocationId && location.uuid === state.app.currentLocationId) {
- pathCurrentLocation = location.path[0];
- }
- return true;
- });
+ if (state.locations) {
+ state.locations.map((location) => {
+ if (state.app.currentLocationId && location.uuid === state.app.currentLocationId) {
+ pathCurrentLocation = location.paths[0];
+ }
+ return true;
+ });
+ }
return pathCurrentLocation;
-}; */
+};
export const isUpdateAvailable = (state: Object) => state.app.isUpdateAvailable;
export const isUpdateInProgress = (state: Object) =>
state.app.isUpdateInProgress;