From fffe4f694fa4bad6ad3985fcdbc0d236f5eb6ecc Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Sat, 3 Apr 2021 22:19:12 +0200 Subject: [PATCH] reset page when doing full text search --- src-ui/src/app/services/document-list-view.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src-ui/src/app/services/document-list-view.service.ts b/src-ui/src/app/services/document-list-view.service.ts index b542358c7..aa82190d7 100644 --- a/src-ui/src/app/services/document-list-view.service.ts +++ b/src-ui/src/app/services/document-list-view.service.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { cloneFilterRules, FilterRule } from '../data/filter-rule'; +import { FILTER_FULLTEXT_MORELIKE, FILTER_FULLTEXT_QUERY } from '../data/filter-rule-type'; import { PaperlessDocument } from '../data/paperless-document'; import { PaperlessSavedView } from '../data/paperless-saved-view'; import { DOCUMENT_LIST_SERVICE } from '../data/storage-keys'; @@ -134,6 +135,9 @@ export class DocumentListViewService { set filterRules(filterRules: FilterRule[]) { this.activeListViewState.filterRules = filterRules + if (filterRules.find(r => (r.rule_type == FILTER_FULLTEXT_QUERY || r.rule_type == FILTER_FULLTEXT_MORELIKE))) { + this.activeListViewState.currentPage = 1 + } this.reload() this.reduceSelectionToFilter() this.saveDocumentListView()