mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-15 15:40:35 +00:00
Prevented empty results from being sorted
This commit is contained in:
@@ -19,7 +19,7 @@ export class ResultTableComponent implements OnInit {
|
|||||||
@ViewChild(CheckboxDirective, { static: true }) checkboxColumn: CheckboxDirective
|
@ViewChild(CheckboxDirective, { static: true }) checkboxColumn: CheckboxDirective
|
||||||
@ViewChildren('tableRow') tableRows: QueryList<ResultTableRowComponent>
|
@ViewChildren('tableRow') tableRows: QueryList<ResultTableRowComponent>
|
||||||
|
|
||||||
results: SongResult[]
|
results: SongResult[] = []
|
||||||
activeRowID: number = null
|
activeRowID: number = null
|
||||||
sortDirection: 'ascending' | 'descending' = 'descending'
|
sortDirection: 'ascending' | 'descending' = 'descending'
|
||||||
sortColumn: 'name' | 'artist' | 'album' | 'genre' | null = null
|
sortColumn: 'name' | 'artist' | 'album' | 'genre' | null = null
|
||||||
@@ -52,6 +52,7 @@ export class ResultTableComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onColClicked(column: 'name' | 'artist' | 'album' | 'genre') {
|
onColClicked(column: 'name' | 'artist' | 'album' | 'genre') {
|
||||||
|
if (this.results.length == 0) { return }
|
||||||
if (this.sortColumn != column) {
|
if (this.sortColumn != column) {
|
||||||
this.sortColumn = column
|
this.sortColumn = column
|
||||||
this.sortDirection = 'descending'
|
this.sortDirection = 'descending'
|
||||||
|
|||||||
Reference in New Issue
Block a user