fix(theming): fix admin-disabled background and user pristine theming settings

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ 2023-01-26 19:52:16 +01:00
parent 494a0c1073
commit 88b5f7e340
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View file

@ -131,6 +131,7 @@ trait CommonThemeTrait {
&& $this->appManager->isEnabledForUser(Application::APP_ID)) {
$themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default');
$currentVersion = (int)$this->config->getUserValue($user->getUID(), Application::APP_ID, 'userCacheBuster', '0');
$globalBackgroundDeleted = $this->config->getAppValue(Application::APP_ID, 'backgroundMime', '') === 'backgroundColor';
// The user uploaded a custom background
if ($themingBackground === 'custom') {
@ -153,12 +154,19 @@ trait CommonThemeTrait {
// The user picked a static colour
if (substr($themingBackground, 0, 1) === '#') {
return [
'--image-background' => 'no',
'--image-background-plain' => 'true',
'--color-background-plain' => $this->themingDefaults->getColorPrimary(),
];
}
}
// Admin disabled the background and the user
// did not customized anything
if ($globalBackgroundDeleted) {
return [
'--image-background-plain' => 'true',
];
}
}
return [];
}
}