fix clearstorage at start

This commit is contained in:
Beu 2023-09-08 21:23:47 +02:00
parent 8b3e624d1c
commit 4bcbda64d6
1 changed files with 8 additions and 6 deletions

View File

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