From 10a7369fecf852546c93e10936dacb3ef99e91fd Mon Sep 17 00:00:00 2001
From: tamaina <tamaina@hotmail.co.jp>
Date: Tue, 11 Feb 2020 22:57:09 +0900
Subject: サーバーから切断されましたのダイアログは時間をおいて表示するように
 (#5916)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* timeout disconnect dialog

* 70ms

* 150ms
---
 src/client/app.vue | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'src/client/app.vue')

diff --git a/src/client/app.vue b/src/client/app.vue
index 32283bd20c..7b4796d747 100644
--- a/src/client/app.vue
+++ b/src/client/app.vue
@@ -247,11 +247,15 @@ export default Vue.extend({
 		}
 
 		this.$root.stream.on('_disconnected_', () => {
-			if (!this.disconnectedDialog) {
-				if (this.$store.state.device.autoReload) {
-					location.reload();
-					return;
-				}
+			if (this.disconnectedDialog) return;
+			if (this.$store.state.device.autoReload) {
+				location.reload();
+				return;
+			}
+
+			setTimeout(() => {
+				if (this.$root.stream.state !== 'reconnecting') return;
+
 				this.disconnectedDialog = this.$root.dialog({
 					type: 'warning',
 					showCancelButton: true,
@@ -263,7 +267,7 @@ export default Vue.extend({
 					}
 					this.disconnectedDialog = null;
 				});
-			}
+			}, 150)
 		});
 	},
 
-- 
cgit v1.3.1-freya

