diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-05-24 05:46:09 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-05-24 05:46:09 +0900 |
| commit | f565e60bcf555dc6a267e33f47dc9922e4ccb6e1 (patch) | |
| tree | 3a4f66ae4eb99c65be9a4a992a49f22efecd7506 /src/client/app/mobile | |
| parent | Refactor (diff) | |
| download | misskey-f565e60bcf555dc6a267e33f47dc9922e4ccb6e1.tar.gz misskey-f565e60bcf555dc6a267e33f47dc9922e4ccb6e1.tar.bz2 misskey-f565e60bcf555dc6a267e33f47dc9922e4ccb6e1.zip | |
Darken
Diffstat (limited to 'src/client/app/mobile')
| -rw-r--r-- | src/client/app/mobile/views/pages/messaging-room.vue | 17 |
1 files changed, 15 insertions, 2 deletions
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; |