feat: consistent sorting

This commit is contained in:
Dominik Pschenitschni
2025-06-01 16:27:38 +02:00
committed by kolaente
parent 2175e5679f
commit ed5d983d18
4 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ export const findCheckboxesInText = (text: string): number[] => {
return [
...checkboxes.checked,
...checkboxes.unchecked,
].sort((a, b) => a < b ? -1 : 1)
].sort((a, b) => a - b)
}
export const getChecklistStatistics = (text: string): CheckboxStatistics => {

View File

@@ -107,7 +107,7 @@ export default class TaskModel extends AbstractModel<ITask> implements ITask {
this.labels = this.labels
.map(l => new LabelModel(l))
.sort((f, s) => f.title > s.title ? 1 : -1)
.sort((a, b) => a.title.localeCompare(b.title))
// Parse the assignees into user models
this.assignees = this.assignees.map(a => {

View File

@@ -238,7 +238,7 @@ export const useProjectStore = defineStore('project', () => {
} else {
views.push(view)
}
views.sort((a, b) => a.position < b.position ? -1 : 1)
views.sort((a, b) => a.position - b.position)
setProject({
...projects.value[view.projectId],

View File

@@ -310,7 +310,7 @@ function useAvailableTimezones(settingsRef: Ref<IUserSettings>) {
if (r.data) {
// Transform timezones into objects with value/label pairs
availableTimezones.value = r.data
.sort()
.sort((a, b) => a.localeCompare(b))
.map((tz: string) => ({
value: tz,
label: tz.replace(/_/g, ' '),