Skip to content

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

Deleting file should not scroll to top (#1574)

Stanimirca8f4b5fa78b
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index 6c5558c4d..f5bee484d 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -2208,7 +2208,9 @@ export const getOpenedFiles = (state: any) => state.app.openedFiles;
export const getNotificationStatus = (state: any) =>
state.app.notificationStatus;
export const getSearchResultCount = (state: any) =>
- state.app.currentDirectoryEntries.length;
+ Object.keys(state.locationIndex.searchQuery).length === 0
+ ? 0
+ : state.app.currentDirectoryEntries.length;
export const getCurrentLocationId = (state: any) => state.app.currentLocationId;
export const isEntryInFullWidth = (state: any) => state.app.isEntryInFullWidth;
export const isLoading = (state: any) => state.app.isLoading;