Alert for already alphabetized

This commit is contained in:
Yukino Song
2025-05-28 22:07:54 +08:00
parent d89f3f75d3
commit 251ae915a6
3 changed files with 12 additions and 2 deletions

View File

@@ -591,8 +591,16 @@
this.listReordered = true;
},
alphabetizeApps() {
this.apps.sort((a, b) => a.name.localeCompare(b.name));
this.listReordered = true;
let orderStat = 0;
this.apps.sort((a, b) => {
const result = a.name.localeCompare(b.name);
orderStat += result;
return result;
});
this.listReordered = orderStat !== this.apps.length - 1;
if (!this.listReordered) {
alert(this.$t('apps.already_ordered'));
}
},
saveOrder() {
this.actionDisabled = true;