diff --git a/src/client/app/common/views/components/messaging-room.form.vue b/src/client/app/common/views/components/messaging-room.form.vue
index 32a43ace57..050906cf44 100644
--- a/src/client/app/common/views/components/messaging-room.form.vue
+++ b/src/client/app/common/views/components/messaging-room.form.vue
@@ -197,7 +197,7 @@ export default Vue.extend({
diff --git a/src/client/app/common/views/components/messaging-room.message.vue b/src/client/app/common/views/components/messaging-room.message.vue
index ba0ab3209f..ef39199dc4 100644
--- a/src/client/app/common/views/components/messaging-room.message.vue
+++ b/src/client/app/common/views/components/messaging-room.message.vue
@@ -59,8 +59,10 @@ export default Vue.extend({
diff --git a/src/client/app/common/views/components/messaging-room.vue b/src/client/app/common/views/components/messaging-room.vue
index 496d66a826..34280d7a22 100644
--- a/src/client/app/common/views/components/messaging-room.vue
+++ b/src/client/app/common/views/components/messaging-room.vue
@@ -244,11 +244,12 @@ export default Vue.extend({
diff --git a/src/client/app/mobile/views/pages/messaging-room.vue b/src/client/app/mobile/views/pages/messaging-room.vue
index c26a9b735e..7fbfa056d1 100644
--- a/src/client/app/mobile/views/pages/messaging-room.vue
+++ b/src/client/app/mobile/views/pages/messaging-room.vue
@@ -16,16 +16,29 @@ export default Vue.extend({
data() {
return {
fetching: true,
- user: null
+ user: null,
+ unwatchDarkmode: null
};
},
watch: {
$route: 'fetch'
},
created() {
- document.documentElement.style.background = '#fff';
+ const applyBg = v =>
+ document.documentElement.style.setProperty('background', v ? '#191b22' : '#fff', 'important');
+
+ this.$nextTick(() => applyBg(this.$store.state.device.darkmode));
+
+ this.unwatchDarkmode = this.$store.watch(s => {
+ return s.device.darkmode;
+ }, applyBg);
+
this.fetch();
},
+ beforeDestroy() {
+ document.documentElement.style.removeProperty('background');
+ this.unwatchDarkmode();
+ },
methods: {
fetch() {
this.fetching = true;