]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not reset background on every save
authorJulius Härtl <jus@bitgrid.net>
Fri, 14 Aug 2020 14:47:17 +0000 (16:47 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 19 Aug 2020 15:07:27 +0000 (17:07 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Controller/DashboardController.php

index 1c11ca245185b8dce80da3f524a5d7e36a85b398..bd83ca458495f4857084fe6638773a5201470f04 100644 (file)
@@ -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([]);
        }