disable the sort button when fewer than two items are present

This commit is contained in:
MaysWind
2026-03-01 23:01:23 +08:00
parent 4845fdedfd
commit d2ce801277
7 changed files with 30 additions and 12 deletions
+15
View File
@@ -124,6 +124,20 @@ export const useAccountsStore = defineStore('accounts', () => {
return shownAccountCount;
});
const maxCategoryAccountCount = computed<number>(() => {
let maxCount = 0;
for (const categorizedAccounts of values(allCategorizedAccountsMap.value)) {
const accountCount = categorizedAccounts.accounts.length;
if (accountCount > maxCount) {
maxCount = accountCount;
}
}
return maxCount;
});
function loadAccountList(accounts: Account[]): void {
allAccounts.value = accounts;
allAccountsMap.value = {};
@@ -1076,6 +1090,7 @@ export const useAccountsStore = defineStore('accounts', () => {
allVisiblePlainAccounts,
allAvailableAccountsCount,
allVisibleAccountsCount,
maxCategoryAccountCount,
// functions
updateAccountListInvalidState,
resetAccounts,