Skip to content

Commit

Permalink
Merge pull request #888 from colinin/fix-no-settings-refresh-by-api
Browse files Browse the repository at this point in the history
fix(settings): 缓存中未找到自定义设置项需要刷新缓存.
  • Loading branch information
colinin authored Oct 9, 2023
2 parents 574802e + 0b79247 commit 41c2bd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/vue/src/store/modules/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export const useSettingManagementStore = defineStore({
actions: {
initlize(settingKey: string, api: (...args) => Promise<ListResultDto<SettingGroup>>) {
this.settingKey = settingKey;
this.settings = ls.get(this.settingKey);
if (this.settings.length === 0) {
this.settings = ls.get(this.settingKey) || this.refreshSettings(api);
this.refreshSettings(api);
}
},
refreshSettings(api: (...args) => Promise<ListResultDto<SettingGroup>>) {
Expand Down

0 comments on commit 41c2bd2

Please sign in to comment.