Skip to content

Commit

Permalink
fix(FE): parse values to ensure we have integer values
Browse files Browse the repository at this point in the history
- seems that in some older version we stored the ids as strings

Signed-off-by: Florian Steffens <florian.steffens@nextcloud.com>
  • Loading branch information
Florian Steffens committed Sep 13, 2023
1 parent 6fef388 commit 18b8ba3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export default class SelectionColumn extends AbstractSelectionColumn {
sort(mode) {
const factor = mode === 'DESC' ? -1 : 1
return (rowA, rowB) => {
const selectionIdA = rowA.data.find(item => item.columnId === this.id)?.value ?? null
const selectionIdA = parseInt(rowA.data.find(item => item.columnId === this.id)?.value ?? null)
const vA = selectionIdA !== null ? this.selectionOptions.find(item => item.id === selectionIdA)?.label : ''
const valueA = this.removeEmoji(vA).trim()
const selectionIdB = rowB.data.find(item => item.columnId === this.id)?.value ?? null
const selectionIdB = parseInt(rowB.data.find(item => item.columnId === this.id)?.value ?? null)
const vB = selectionIdB !== null ? this.selectionOptions.find(item => item.id === selectionIdB)?.label : ''
const valueB = this.removeEmoji(vB).trim()
return ((valueA < valueB) ? -1 : (valueA > valueB) ? 1 : 0) * factor
Expand Down

0 comments on commit 18b8ba3

Please sign in to comment.