Fix synchronizing settings on page load
This commit is contained in:
parent
58a558247b
commit
309be48906
@ -10,8 +10,9 @@ export const config = normalizeConfig({
|
||||
syncSettings: {
|
||||
default: true,
|
||||
sync: "never",
|
||||
apply(store, value) {
|
||||
if (value) {
|
||||
apply(store, value, auto = false) {
|
||||
// If applied by settings/applyAll, do not emit to server
|
||||
if (value && !auto) {
|
||||
socket.emit("setting:get");
|
||||
}
|
||||
},
|
||||
|
@ -10,7 +10,6 @@ socket.once("configuration", function(data) {
|
||||
// 'theme' setting depends on serverConfiguration.themes so
|
||||
// settings cannot be applied before this point
|
||||
store.dispatch("settings/applyAll");
|
||||
socket.emit("setting:get");
|
||||
|
||||
if (data.fileUpload) {
|
||||
upload.initialize();
|
||||
|
@ -22,6 +22,8 @@ socket.on("init", function(data) {
|
||||
|
||||
store.commit("appLoaded");
|
||||
|
||||
socket.emit("setting:get");
|
||||
|
||||
if (window.g_TheLoungeRemoveLoading) {
|
||||
window.g_TheLoungeRemoveLoading();
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export function createSettingsStore(store) {
|
||||
},
|
||||
applyAll({state}) {
|
||||
for (const settingName in config) {
|
||||
config[settingName].apply(store, state[settingName]);
|
||||
config[settingName].apply(store, state[settingName], true);
|
||||
}
|
||||
},
|
||||
update({state, commit}, {name, value, sync = false}) {
|
||||
|
Loading…
Reference in New Issue
Block a user