only update darkmode pref, if necessary

This commit is contained in:
ralf 2022-09-24 14:27:17 +02:00
parent 086d92e957
commit 9ab4c69050

View File

@ -1387,8 +1387,12 @@ window.fw_base = (function(){ "use strict"; return Class.extend(
}
})
egw.setSessionItem('api', 'darkmode',state);
egw.json('EGroupware\\Api\\Framework\\Ajax::ajax_set_darkmode_flag',[state]).sendRequest();
// only update darkmode pref, if necessary
if (egw.getSessionItem('api', 'darkmode') !== state)
{
egw.setSessionItem('api', 'darkmode',state);
egw.json('EGroupware\\Api\\Framework\\Ajax::ajax_set_darkmode_flag',[state]).sendRequest();
}
},
/**
@ -1412,4 +1416,4 @@ window.fw_base = (function(){ "use strict"; return Class.extend(
gauge.width(this.firstload_animation_gauge+"%");
if (_gauge == 100) window.setTimeout(function(){jQuery('#egw_fw_firstload').remove();},1000);
}
});}).call(window);
});}).call(window);