* Fix #5782 fix duplicated disconnected dialog * fix
This commit is contained in:
parent
13abd6596e
commit
0252e9b4b7
1 changed files with 14 additions and 9 deletions
|
@ -167,6 +167,7 @@ export default Vue.extend({
|
||||||
widgetsEditMode: false,
|
widgetsEditMode: false,
|
||||||
enableWidgets: window.innerWidth >= 1100,
|
enableWidgets: window.innerWidth >= 1100,
|
||||||
canBack: false,
|
canBack: false,
|
||||||
|
disconnectedDialog: null as Promise<void> | null,
|
||||||
faChevronLeft, faComments, faHashtag, faBroadcastTower, faFireAlt, faEllipsisH, faPencilAlt, faBars, faTimes, faBell, faSearch, faUserCog, faCog, faUser, faHome, faStar, faCircle, faAt, faEnvelope, faListUl, faPlus, faUserClock, faLaugh, faUsers, faTachometerAlt, faExchangeAlt, faGlobe, faChartBar, faCloud, faServer
|
faChevronLeft, faComments, faHashtag, faBroadcastTower, faFireAlt, faEllipsisH, faPencilAlt, faBars, faTimes, faBell, faSearch, faUserCog, faCog, faUser, faHome, faStar, faCircle, faAt, faEnvelope, faListUl, faPlus, faUserClock, faLaugh, faUsers, faTachometerAlt, faExchangeAlt, faGlobe, faChartBar, faCloud, faServer
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -217,16 +218,20 @@ export default Vue.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$root.stream.on('_disconnected_', async () => {
|
this.$root.stream.on('_disconnected_', () => {
|
||||||
const confirm = await this.$root.dialog({
|
if (!this.disconnectedDialog) {
|
||||||
|
this.disconnectedDialog = this.$root.dialog({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
title: this.$t('disconnectedFromServer'),
|
title: this.$t('disconnectedFromServer'),
|
||||||
text: this.$t('reloadConfirm'),
|
text: this.$t('reloadConfirm'),
|
||||||
});
|
}).then(({ canceled }) => {
|
||||||
if (!confirm.canceled) {
|
if (!canceled) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
this.disconnectedDialog = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
|
Loading…
Reference in a new issue