mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(theming): Use AppConfig for setting background image
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
31ad1c5f55
commit
60083b1b5f
2 changed files with 4 additions and 1 deletions
|
|
@ -18,6 +18,7 @@ use OCP\Files\NotFoundException;
|
|||
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;
|
||||
|
|
@ -200,6 +201,7 @@ class BackgroundService {
|
|||
public function __construct(
|
||||
private IRootFolder $rootFolder,
|
||||
private IAppData $appData,
|
||||
private IAppConfig $appConfig,
|
||||
private IConfig $config,
|
||||
private ?string $userId,
|
||||
) {
|
||||
|
|
@ -328,7 +330,7 @@ class BackgroundService {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1041,6 +1041,7 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
$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'),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue