Added search loading icon

This commit is contained in:
Geomitron
2020-05-26 22:04:48 -04:00
parent 444ff40533
commit 2b5c64d376
4 changed files with 11 additions and 8 deletions

View File

@@ -18,8 +18,9 @@ export class SearchService {
constructor(private electronService: ElectronService) { }
async newSearch(query: string) {
if (this.awaitingResults) { return }
this.awaitingResults = true
this.currentQuery = { query, type: SearchType.Any, offset: 0, length: 20 + 1 } // TODO: make length a setting
this.currentQuery = { query, type: SearchType.Any, offset: 0, length: 50 + 1 } // TODO: make length a setting
this.results = this.trimLastChart(await this.electronService.invoke('song-search', this.currentQuery))
this.awaitingResults = false
@@ -27,6 +28,10 @@ export class SearchService {
this.newResultsEmitter.emit(this.results)
}
isLoading() {
return this.awaitingResults
}
/**
* Event emitted when new search results are returned
* or when more results are added to an existing search.