summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-08-14 16:47:17 +0200
committerJulius Härtl <jus@bitgrid.net>2020-08-19 17:07:27 +0200
commit4118cb0be6f821140737c4dc63b42bd93cd3eeb5 (patch)
treef108a6a21187579a90c6417cdbf515ffc7fcadff /apps
parent338f09b04bf096254253c8319c83e65c35aeb7ac (diff)
downloadnextcloud-server-4118cb0be6f821140737c4dc63b42bd93cd3eeb5.tar.gz
nextcloud-server-4118cb0be6f821140737c4dc63b42bd93cd3eeb5.zip
Do not reset background on every save
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 1c11ca24518..bd83ca45849 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -127,19 +127,16 @@ class DashboardController extends Controller {
* @NoAdminRequired
*/
public function setBackground($path = null, $url = null, $shipped = null): JSONResponse {
- // FIXME: store current version of the background and return the result
- // FIXME: handle shipped backgrounds avoid file duplication
- // FIXME: allow to reset to default ones
if ($shipped !== null) {
$this->backgroundService->setShippedBackground($shipped);
- }
- if ($path !== null) {
+ } else if ($path !== null) {
$this->backgroundService->setFileBackground($path);
- }
- if ($url !== null) {
+ } else if ($url !== null) {
$this->backgroundService->setUrlBackground($url);
+ } else {
+ $this->backgroundService->setDefaultBackground();
}
- $this->backgroundService->setDefaultBackground();
+
return new JSONResponse([]);
}