mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
FIx: obliquely trim spaces from global search (#8484)
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
} from '@angular/core'
|
||||
import { Router } from '@angular/router'
|
||||
import { NgbDropdown, NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { Subject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs'
|
||||
import { Subject, debounceTime, distinctUntilChanged, filter } from 'rxjs'
|
||||
import { DataType } from 'src/app/data/datatype'
|
||||
import {
|
||||
FILTER_FULLTEXT_QUERY,
|
||||
@@ -89,7 +89,6 @@ export class GlobalSearchComponent implements OnInit {
|
||||
this.queryDebounce
|
||||
.pipe(
|
||||
debounceTime(400),
|
||||
map((query) => query?.trim()),
|
||||
filter((query) => !query?.length || query?.length > 2),
|
||||
distinctUntilChanged()
|
||||
)
|
||||
@@ -109,7 +108,7 @@ export class GlobalSearchComponent implements OnInit {
|
||||
|
||||
private search(query: string) {
|
||||
this.loading = true
|
||||
this.searchService.globalSearch(query).subscribe((results) => {
|
||||
this.searchService.globalSearch(query.trim()).subscribe((results) => {
|
||||
this.searchResults = results
|
||||
this.loading = false
|
||||
this.resultsDropdown.open()
|
||||
|
Reference in New Issue
Block a user