From 69802a9f004881970c0f2fe11fb646ee4c65d6d2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 6 Feb 2020 17:21:28 +0900 Subject: Resolve #5850 --- src/client/app.vue | 4 ++++ src/client/pages/settings/general.vue | 8 ++++++++ src/client/store.ts | 1 + 3 files changed, 13 insertions(+) (limited to 'src') diff --git a/src/client/app.vue b/src/client/app.vue index 847a9827e0..d1bc610f73 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -222,6 +222,10 @@ export default Vue.extend({ this.$root.stream.on('_disconnected_', () => { if (!this.disconnectedDialog) { + if (this.$store.state.device.autoReload) { + location.reload(); + return; + } this.disconnectedDialog = this.$root.dialog({ type: 'warning', showCancelButton: true, diff --git a/src/client/pages/settings/general.vue b/src/client/pages/settings/general.vue index f5c2f4ceeb..5b04077f3c 100644 --- a/src/client/pages/settings/general.vue +++ b/src/client/pages/settings/general.vue @@ -10,6 +10,9 @@ {{ $t('removeWallpaper') }}
+ + {{ $t('autoReloadWhenDisconnected') }} + {{ $t('auto-watch') }} @@ -52,6 +55,11 @@ export default Vue.extend({ get() { return this.$store.state.settings.wallpaper; }, set(value) { this.$store.dispatch('settings/set', { key: 'wallpaper', value }); } }, + + autoReload: { + get() { return this.$store.state.device.autoReload; }, + set(value) { this.$store.commit('device/set', { key: 'autoReload', value }); } + }, }, methods: { diff --git a/src/client/store.ts b/src/client/store.ts index 73112829e1..d656d932b5 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -22,6 +22,7 @@ const defaultDeviceSettings = { loadRawImages: false, alwaysShowNsfw: false, useOsDefaultEmojis: false, + autoReload: false, accounts: [], recentEmojis: [], visibility: 'public', -- cgit v1.2.3-freya