Skip to content

Commit

Permalink
Re-Apply: Fix SSE failure toast container not removed (openhab#2182)
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 <[email protected]>
  • Loading branch information
florian-h05 authored Nov 22, 2023
1 parent 9981c87 commit d8e29f1
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 d8e29f1

Please sign in to comment.