mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-07-07 18:45:09 +00:00
Fixed scrolling displaying duplicate results
This commit is contained in:
@@ -69,7 +69,7 @@ export class SearchService {
|
|||||||
async updateScroll() {
|
async updateScroll() {
|
||||||
if (!this.awaitingResults && !this._allResultsVisible) {
|
if (!this.awaitingResults && !this._allResultsVisible) {
|
||||||
this.awaitingResults = true
|
this.awaitingResults = true
|
||||||
this.currentQuery.offset += 20
|
this.currentQuery.offset += 50
|
||||||
this.results.push(...this.trimLastChart(await this.electronService.invoke('song-search', this.currentQuery)))
|
this.results.push(...this.trimLastChart(await this.electronService.invoke('song-search', this.currentQuery)))
|
||||||
this.awaitingResults = false
|
this.awaitingResults = false
|
||||||
|
|
||||||
@@ -78,8 +78,8 @@ export class SearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trimLastChart(results: SongResult[]) {
|
trimLastChart(results: SongResult[]) {
|
||||||
if (results.length > 20) {
|
if (results.length > 50) {
|
||||||
results.splice(20, 1)
|
results.splice(50, 1)
|
||||||
this._allResultsVisible = false
|
this._allResultsVisible = false
|
||||||
} else {
|
} else {
|
||||||
this._allResultsVisible = true
|
this._allResultsVisible = true
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class SearchHandler implements IPCInvokeHandler<'song-search'> {
|
|||||||
event: 'song-search' = 'song-search'
|
event: 'song-search' = 'song-search'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns the top 20 songs that match `search`.
|
* @returns the top 50 songs that match `search`.
|
||||||
*/
|
*/
|
||||||
async handler(search: SongSearch) {
|
async handler(search: SongSearch) {
|
||||||
return new Promise<SongResult[]>((resolve, reject) => {
|
return new Promise<SongResult[]>((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user