fix clearstorage at start

This commit is contained in:
Beu 2023-09-08 21:23:47 +02:00
parent 8b3e624d1c
commit 4bcbda64d6

View File

@ -125,7 +125,8 @@ class SettingManager implements CallbackListener, UsageInformationAble {
* Handle After Init Callback
*/
public function handleAfterInit() {
$this->disableCache = $this->getSettingValue($this, self::SETTING_DISABLE_SETTING_CACHE);
$this->disableCache = boolval($this->getSettingValue($this, self::SETTING_DISABLE_SETTING_CACHE));
if ($this->disableCache) $this->clearStorage();
$this->deleteUnusedSettings();
}
@ -439,14 +440,15 @@ class SettingManager implements CallbackListener, UsageInformationAble {
// Trigger Settings Changed Callback
if (!$init) {
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_SETTING_CHANGED, $setting);
}
// during the init, value = default
if ($setting->setting === self::SETTING_DISABLE_SETTING_CACHE) {
$this->disableCache = $setting->value;
$this->disableCache = boolval($setting->value);
if ($this->disableCache) {
$this->clearStorage();
}
}
}
return true;
}