]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix late night errors
authorJulius Härtl <jus@bitgrid.net>
Tue, 18 Aug 2020 09:57:01 +0000 (11:57 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 19 Aug 2020 15:07:28 +0000 (17:07 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Service/BackgroundService.php
apps/dashboard/src/components/BackgroundSettings.vue

index 2b59bef65d9ac5f2e2db0953d94810cfd84e762a..30e9d9fe3cb330fdfa514a0396359cb61a380ee1 100644 (file)
@@ -107,7 +107,7 @@ class BackgroundService {
        }
 
        public function setShippedBackground($fileName) {
-               if (!in_array($fileName, self::SHIPPED_BACKGROUNDS)) {
+               if (!array_key_exists($fileName, self::SHIPPED_BACKGROUNDS)) {
                        throw new \InvalidArgumentException('The given file name is invalid');
                }
                $this->config->setUserValue($this->userId, 'dashboard', 'background', $fileName);
index accc094f52318c86a63f54a60fe6d506ed8e3a38..65f70614d7bc065f32fe9d9fca504d1e434219e1 100644 (file)
@@ -95,6 +95,11 @@ export default {
                async update(data) {
                        const background = data.type === 'custom' || data.type === 'default' ? data.type : data.value
                        this.backgroundImage = getBackgroundUrl(background, data.version)
+                       if (data.type === 'color') {
+                               this.$emit('updateBackground', data)
+                               this.loading = false
+                               return
+                       }
                        const image = new Image()
                        image.onload = () => {
                                this.$emit('updateBackground', data)