Browse Source
Merge pull request #900 from colinin/fix-settings
fix(settings): getting a setting from the cache may be an invalid value.
pull/914/head
yx lin
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
1 additions and
2 deletions
-
apps/vue/src/hooks/web/useExtraPropTranslation.ts
-
apps/vue/src/store/modules/settings.ts
|
|
|
@ -1,5 +1,4 @@ |
|
|
|
import { useI18n } from './useI18n'; |
|
|
|
import { IHasExtraProperties } from '/@/api/model/baseModel'; |
|
|
|
|
|
|
|
export function useExtraPropTranslation() { |
|
|
|
const { t } = useI18n(); |
|
|
|
|
|
|
|
@ -27,7 +27,7 @@ export const useSettingManagementStore = defineStore({ |
|
|
|
initlize(settingKey: string, api: (...args) => Promise<ListResultDto<SettingGroup>>) { |
|
|
|
this.settingKey = settingKey; |
|
|
|
this.settings = ls.get(this.settingKey); |
|
|
|
if (this.settings.length === 0) { |
|
|
|
if (!this.settings || this.settings.length === 0) { |
|
|
|
this.refreshSettings(api); |
|
|
|
} |
|
|
|
}, |
|
|
|
|