Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable30] fix(theming): Use AppConfig for setting background image #48452

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/theming/lib/Service/BackgroundService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use OCP\Files\NotPermittedException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\IAppConfig;
use OCP\IConfig;
use OCP\Lock\LockedException;
use OCP\PreConditionNotMetException;
Expand Down Expand Up @@ -200,6 +201,7 @@ class BackgroundService {
public function __construct(
private IRootFolder $rootFolder,
private IAppData $appData,
private IAppConfig $appConfig,
private IConfig $config,
private ?string $userId,
) {
Expand Down Expand Up @@ -328,7 +330,7 @@ public function setGlobalBackground($path): string|null {
if ($handle && $image->loadFromFileHandle($handle) !== false) {
$meanColor = $this->calculateMeanColor($image);
if ($meanColor !== false) {
$this->config->setAppValue(Application::APP_ID, 'background_color', $meanColor);
$this->appConfig->setValueString(Application::APP_ID, 'background_color', $meanColor);
return $meanColor;
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ public function __construct($webRoot, \OC\Config $config) {
$backgroundService = new BackgroundService(
$c->get(IRootFolder::class),
$c->getAppDataDir('theming'),
$c->get(IAppConfig::class),
$c->get(\OCP\IConfig::class),
$c->get(ISession::class)->get('user_id'),
);
Expand Down
Loading