diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-10-06 12:36:59 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-10-13 12:13:39 +0200 |
commit | 9a92fe9b29fb0db0486cebdc869627e0ac3bd4ea (patch) | |
tree | 6d9673909ddacdf3c2697dc14c8d7a725b605cbc /apps/theming/lib | |
parent | db831359d3ad10d35536bd5f0e72ba629b828471 (diff) | |
download | nextcloud-server-9a92fe9b29fb0db0486cebdc869627e0ac3bd4ea.tar.gz nextcloud-server-9a92fe9b29fb0db0486cebdc869627e0ac3bd4ea.zip |
Fix primary and debounce to avoid infinite loop
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Themes/DefaultTheme.php | 9 | ||||
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index b6c84e82d7b..4dce1dca809 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -67,11 +67,12 @@ class DefaultTheme implements ITheme { $this->l = $l; $this->defaultPrimaryColor = $this->themingDefaults->getDefaultColorPrimary(); + $this->primaryColor = $this->themingDefaults->getColorPrimary(); - // Override default codefaultPrimaryColorlor if set to improve accessibility - $this->primaryColor = $this->defaultPrimaryColor === BackgroundService::DEFAULT_COLOR - ? BackgroundService::DEFAULT_ACCESSIBLE_COLOR - : $this->themingDefaults->getColorPrimary(); + // Override default defaultPrimaryColor if set to improve accessibility + if ($this->primaryColor === BackgroundService::DEFAULT_COLOR) { + $this->primaryColor = BackgroundService::DEFAULT_ACCESSIBLE_COLOR; + } } public function getId(): string { diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index b1fb90e00e0..dce6b875db1 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -226,7 +226,7 @@ class ThemingDefaults extends \OC_Defaults { // user-defined primary color $themingBackground = ''; if (!empty($user)) { - $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', 'default'); + $themingBackground = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background', ''); // if the user-selected background is a background reference if (!preg_match('/^\#([0-9a-f]{3}|[0-9a-f]{6})$/i', $themingBackground)) { |