diff --git a/pkg/models/user_app_cloud_setting.go b/pkg/models/user_app_cloud_setting.go index 286841bd..09548b82 100644 --- a/pkg/models/user_app_cloud_setting.go +++ b/pkg/models/user_app_cloud_setting.go @@ -33,7 +33,8 @@ var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationClo "insightsExplorerDefaultDateRangeType": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER, "showTagInInsightsExplorerPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, // Account List Page - "totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP, + "totalAmountExcludeAccountIds": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING_BOOLEAN_MAP, + "hideCategoriesWithoutAccounts": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN, // Exchange Rates Data Page "currencySortByInExchangeRatesPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER, // Statistics Settings diff --git a/src/core/setting.ts b/src/core/setting.ts index e2d6e849..776f1ccf 100644 --- a/src/core/setting.ts +++ b/src/core/setting.ts @@ -55,6 +55,7 @@ export interface ApplicationSettings extends BaseApplicationSetting { showTagInInsightsExplorerPage: boolean; // Account List Page totalAmountExcludeAccountIds: Record; + hideCategoriesWithoutAccounts: boolean; // Exchange Rates Data Page currencySortByInExchangeRatesPage: number; // Statistics Settings @@ -120,6 +121,7 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record { updateUserApplicationCloudSettingValue('totalAmountExcludeAccountIds', value); } + function setHideCategoriesWithoutAccounts(value: boolean): void { + updateApplicationSettingsValue('hideCategoriesWithoutAccounts', value); + appSettings.value.hideCategoriesWithoutAccounts = value; + updateUserApplicationCloudSettingValue('hideCategoriesWithoutAccounts', value); + } + // Exchange Rates Data Page function setCurrencySortByInExchangeRatesPage(value: number): void { updateApplicationSettingsValue('currencySortByInExchangeRatesPage', value); @@ -485,6 +491,7 @@ export const useSettingsStore = defineStore('settings', () => { setShowTagInInsightsExplorerPage, // -- Account List Page setTotalAmountExcludeAccountIds, + setHideCategoriesWithoutAccounts, // -- Exchange Rates Data Page setCurrencySortByInExchangeRatesPage, // -- Statistics Settings diff --git a/src/views/base/settings/AppCloudSyncPageBase.ts b/src/views/base/settings/AppCloudSyncPageBase.ts index 6d5062c3..5647b375 100644 --- a/src/views/base/settings/AppCloudSyncPageBase.ts +++ b/src/views/base/settings/AppCloudSyncPageBase.ts @@ -60,7 +60,8 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI { categoryName: 'Account List Page', items: [ - { settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true } + { settingKey: 'totalAmountExcludeAccountIds', settingName: 'Accounts Included in Total', mobile: true, desktop: true }, + { settingKey: 'hideCategoriesWithoutAccounts', settingName: 'Hide Categories Without Accounts', mobile: false, desktop: true } ] }, { diff --git a/src/views/desktop/accounts/ListPage.vue b/src/views/desktop/accounts/ListPage.vue index 67b8032d..3fd12de3 100644 --- a/src/views/desktop/accounts/ListPage.vue +++ b/src/views/desktop/accounts/ListPage.vue @@ -31,7 +31,8 @@