diff --git a/src/app/components/browse/search-bar/search-bar.component.html b/src/app/components/browse/search-bar/search-bar.component.html index 434839f..2c5f51a 100644 --- a/src/app/components/browse/search-bar/search-bar.component.html +++ b/src/app/components/browse/search-bar/search-bar.component.html @@ -1,15 +1,15 @@
--> diff --git a/src/app/components/browse/search-bar/search-bar.component.ts b/src/app/components/browse/search-bar/search-bar.component.ts index 9c6ecb8..c791ccf 100644 --- a/src/app/components/browse/search-bar/search-bar.component.ts +++ b/src/app/components/browse/search-bar/search-bar.component.ts @@ -8,7 +8,7 @@ import { SearchService } from 'src/app/core/services/search.service' }) export class SearchBarComponent implements AfterViewInit { - constructor(private searchService: SearchService) { } + constructor(public searchService: SearchService) { } ngAfterViewInit() { $('.ui.dropdown').dropdown() diff --git a/src/app/core/services/search.service.ts b/src/app/core/services/search.service.ts index c57c434..1923146 100644 --- a/src/app/core/services/search.service.ts +++ b/src/app/core/services/search.service.ts @@ -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. diff --git a/src/electron/ipc/download/FileTransfer.ts b/src/electron/ipc/download/FileTransfer.ts index 4c589c3..1fa642f 100644 --- a/src/electron/ipc/download/FileTransfer.ts +++ b/src/electron/ipc/download/FileTransfer.ts @@ -82,8 +82,6 @@ export class FileTransfer { } } else { // TODO: handle other common problems, like chart/audio files not named correctly - // TODO: this could have been a chart pack; have option to only keep selected chart? - // (think about a user trying to download a set of charts in a pack) } } }