Skip to content

Commit

Permalink
Fix SSE failure toast container not removed
Browse files Browse the repository at this point in the history
This re-applies the fix from openhab#2075, which must have been lost while rebasing openhab#1987.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Nov 22, 2023
1 parent f053166 commit 482258f
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default {
text: message,
closeButton: reloadButton,
closeButtonText: this.$t('dialogs.reload'),
destroyOnClose: autoClose,
destroyOnClose: true,
closeTimeout: (autoClose) ? 5000 : undefined,
cssClass: 'failure-toast button-outline',
position: 'bottom',
Expand All @@ -51,15 +51,13 @@ export default {
this.communicationFailureTimeoutId = setTimeout(() => {
if (this.communicationFailureToast !== null) return
this.communicationFailureToast = this.displayFailureToast(this.$t('error.communicationFailure'), true, false)
this.communicationFailureToast.open()
this.communicationFailureTimeoutId = null
}, 1000)
}
} else if (mutation.payload === true) {
if (this.communicationFailureTimeoutId !== null) clearTimeout(this.communicationFailureTimeoutId)
if (this.communicationFailureToast !== null) {
this.communicationFailureToast.close()
this.communicationFailureToast.destroy()
this.communicationFailureToast = null
}
}
Expand Down

0 comments on commit 482258f

Please sign in to comment.