This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
The mounted hook calls the storage setter when it appears to intend to read the saved language.
Code references:
|
mounted: function () { |
|
this.$i18n.locale = |
|
this.$storage.setStorageSync("lang") || this.$i18n.locale; |
|
updatelang: function (value) { |
|
this.$i18n.locale = value; |
|
this.$storage.setStorageSync("lang", value); |
|
this.update_navi(); |
Relevant snippet:
this.$i18n.locale =
this.$storage.setStorageSync("lang") || this.$i18n.locale;
Impact
A previously selected language is not restored on reload. Depending on the storage helper behavior, the call may also overwrite the saved lang value with an empty value.
Suggested fix
Use getStorageSync("lang") in mounted() and keep setStorageSync("lang", value) only in the language update handler.
This issue was found during a Codex global code scan of the repository.
Baseline commit: e3c5b38
Problem
The mounted hook calls the storage setter when it appears to intend to read the saved language.
Code references:
dpgui/src/App.vue
Lines 101 to 103 in e3c5b38
dpgui/src/App.vue
Lines 208 to 211 in e3c5b38
Relevant snippet:
Impact
A previously selected language is not restored on reload. Depending on the storage helper behavior, the call may also overwrite the saved
langvalue with an empty value.Suggested fix
Use
getStorageSync("lang")inmounted()and keepsetStorageSync("lang", value)only in the language update handler.