mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Add minimum length to text filter
This commit is contained in:
		| @@ -12,7 +12,7 @@ import { PaperlessTag } from 'src/app/data/paperless-tag' | ||||
| import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent' | ||||
| import { PaperlessDocumentType } from 'src/app/data/paperless-document-type' | ||||
| import { Subject, Subscription } from 'rxjs' | ||||
| import { debounceTime, distinctUntilChanged } from 'rxjs/operators' | ||||
| import { debounceTime, distinctUntilChanged, filter } from 'rxjs/operators' | ||||
| import { DocumentTypeService } from 'src/app/services/rest/document-type.service' | ||||
| import { TagService } from 'src/app/services/rest/tag.service' | ||||
| import { CorrespondentService } from 'src/app/services/rest/correspondent.service' | ||||
| @@ -422,7 +422,11 @@ export class FilterEditorComponent implements OnInit, OnDestroy { | ||||
|     this.textFilterDebounce = new Subject<string>() | ||||
|  | ||||
|     this.subscription = this.textFilterDebounce | ||||
|       .pipe(debounceTime(400), distinctUntilChanged()) | ||||
|       .pipe( | ||||
|         debounceTime(400), | ||||
|         distinctUntilChanged(), | ||||
|         filter((query) => !query.length || query.length > 2) | ||||
|       ) | ||||
|       .subscribe((text) => { | ||||
|         this._textFilter = text | ||||
|         this.documentService.searchQuery = text | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Michael Shamoon
					Michael Shamoon