Skip to content

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

Bug with saved search queries (#1932)

Stanimireabf804239eb
diff --git a/app/components/SearchPopover.tsx b/app/components/SearchPopover.tsx
index c801c7334..1fa005942 100644
--- a/app/components/SearchPopover.tsx
+++ b/app/components/SearchPopover.tsx
@@ -225,7 +225,7 @@ function SearchPopover(props: Props) {
if (!savedSearch) {
return true;
}
- props.setTextQuery(savedSearch.textQuery);
+ props.setTextQuery(savedSearch.textQuery ? savedSearch.textQuery : '');
fileTypes.current = savedSearch.fileTypes;
lastModified.current = savedSearch.lastModified;
fileSize.current = savedSearch.fileSize;
diff --git a/app/reducers/searches.ts b/app/reducers/searches.ts
index 05c641ec6..a54604bf3 100644
--- a/app/reducers/searches.ts
+++ b/app/reducers/searches.ts
@@ -32,10 +32,11 @@ export const types = {
export default (state: Array<TS.SearchQuery> = initialState, action: any) => {
switch (action.type) {
case types.ADD_SEARCH: {
+ const { maxSearchResults, ...search } = action.search;
return [
...state,
{
- ...action.search
+ ...search
// creationDate: new Date().getTime()
}
];