Skip to content

Commit fcce709

Browse files
committed
Allow server to override settings
1 parent e08bf0c commit fcce709

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/store/settings/mutations.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,25 @@ export default {
9191
initSettings(state, data) {
9292
if (!state.lang) state.lang = data.lang;
9393
if (!state.windowsConfig) state.windowsConfig = data.windowsConfig;
94+
95+
// Allow server to overide
96+
// overwrite headers - Axios
97+
if (Object.prototype.hasOwnProperty.call(data, 'headers')) {
98+
state.headers = data.headers;
99+
}
100+
101+
// language
102+
if (Object.prototype.hasOwnProperty.call(data, 'lang')) {
103+
state.lang = data.lang;
104+
}
105+
// add new translation
106+
if (Object.prototype.hasOwnProperty.call(data, 'translation')) {
107+
Vue.set(state.translations, data.translation.name, Object.freeze(data.translation.content));
108+
}
109+
// extra configurations
110+
if (Object.prototype.hasOwnProperty.call(data, 'extConfig')) {
111+
state.ext_config = data.ext_config;
112+
}
94113
state.acl = data.acl;
95114
},
96115
};

0 commit comments

Comments
 (0)