mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-09 05:54:34 +02:00
Set case-insensitive sorting as default & Add a user pref to restore legacy behavior - Closes #347
This commit is contained in:
10
resources/js/stores/twofaccounts.js
vendored
10
resources/js/stores/twofaccounts.js
vendored
@ -181,7 +181,10 @@ export const useTwofaccounts = defineStore({
|
||||
* Sorts accounts ascending
|
||||
*/
|
||||
sortAsc() {
|
||||
this.items.sort((a, b) => a.service > b.service ? 1 : -1)
|
||||
if (useUserStore().preferences.sortCaseSensitive) {
|
||||
this.items.sort((a, b) => a.service > b.service ? 1 : -1)
|
||||
}
|
||||
else this.items.sort((a, b) => a.service.toLowerCase() > b.service.toLowerCase() ? 1 : -1)
|
||||
this.saveOrder()
|
||||
},
|
||||
|
||||
@ -189,7 +192,10 @@ export const useTwofaccounts = defineStore({
|
||||
* Sorts accounts descending
|
||||
*/
|
||||
sortDesc() {
|
||||
this.items.sort((a, b) => a.service < b.service ? 1 : -1)
|
||||
if (useUserStore().preferences.sortCaseSensitive) {
|
||||
this.items.sort((a, b) => a.service < b.service ? 1 : -1)
|
||||
}
|
||||
else this.items.sort((a, b) => a.service.toLowerCase() < b.service.toLowerCase() ? 1 : -1)
|
||||
this.saveOrder()
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user