mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 22:29:38 +00:00
Added search loading icon
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user