forked from FoundKeyGang/FoundKey
サーバーから切断されましたのダイアログは時間をおいて表示するように (#5916)
* timeout disconnect dialog * 70ms * 150ms
This commit is contained in:
parent
9fb5579701
commit
10a7369fec
2 changed files with 11 additions and 7 deletions
|
@ -247,11 +247,15 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$root.stream.on('_disconnected_', () => {
|
this.$root.stream.on('_disconnected_', () => {
|
||||||
if (!this.disconnectedDialog) {
|
if (this.disconnectedDialog) return;
|
||||||
if (this.$store.state.device.autoReload) {
|
if (this.$store.state.device.autoReload) {
|
||||||
location.reload();
|
location.reload();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.$root.stream.state !== 'reconnecting') return;
|
||||||
|
|
||||||
this.disconnectedDialog = this.$root.dialog({
|
this.disconnectedDialog = this.$root.dialog({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
|
@ -263,7 +267,7 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
this.disconnectedDialog = null;
|
this.disconnectedDialog = null;
|
||||||
});
|
});
|
||||||
}
|
}, 150)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import MiOS from '../mios';
|
||||||
*/
|
*/
|
||||||
export default class Stream extends EventEmitter {
|
export default class Stream extends EventEmitter {
|
||||||
private stream: ReconnectingWebsocket;
|
private stream: ReconnectingWebsocket;
|
||||||
public state: string;
|
public state: 'initializing' | 'reconnecting' | 'connected';
|
||||||
private sharedConnectionPools: Pool[] = [];
|
private sharedConnectionPools: Pool[] = [];
|
||||||
private sharedConnections: SharedConnection[] = [];
|
private sharedConnections: SharedConnection[] = [];
|
||||||
private nonSharedConnections: NonSharedConnection[] = [];
|
private nonSharedConnections: NonSharedConnection[] = [];
|
||||||
|
|
Loading…
Reference in a new issue