From 93af7ee36a6956d4ec3d0ffd57ec733ddc7cd4e9 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
Date: Fri, 18 Dec 2020 01:01:58 +0200
Subject: [PATCH] simplified code, review

---
 src/App.js | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/App.js b/src/App.js
index c79184abe..1ca029b69 100644
--- a/src/App.js
+++ b/src/App.js
@@ -15,6 +15,7 @@ import UserReportingModal from './components/user_reporting_modal/user_reporting
 import PostStatusModal from './components/post_status_modal/post_status_modal.vue'
 import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue'
 import { windowWidth, windowHeight } from './services/window_utils/window_utils'
+import { mapGetters } from 'vuex'
 
 export default {
   name: 'app',
@@ -50,17 +51,15 @@ export default {
   },
   computed: {
     currentUser () { return this.$store.state.users.currentUser },
-    background () {
-      return this.currentUser.background_image || this.$store.state.instance.background
+    userBackground () { return this.currentUser.background_image },
+    instanceBackground () {
+      return this.mergedConfig.hideInstanceWallpaper
+        ? null
+        : this.$store.state.instance.background
     },
+    background () { return this.userBackground || this.instanceBackground },
     bgStyle () {
-      if (
-        this.currentUser.background_image ||
-          (
-            this.$store.state.instance.background &&
-              !this.$store.getters.mergedConfig.hideInstanceWallpaper
-          )
-      ) {
+      if (this.background) {
         return {
           '--body-background-image': `url(${this.background})`
         }
@@ -80,7 +79,8 @@ export default {
       return {
         'order': this.$store.state.instance.sidebarRight ? 99 : 0
       }
-    }
+    },
+    ...mapGetters(['mergedConfig'])
   },
   methods: {
     updateMobileState () {
-- 
GitLab