From a05c3646b1224737bc12276e0edf3cc95bc72d98 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Tue, 20 Jul 2021 13:53:12 -0700 Subject: [PATCH] Make decryption error toast stick around until interaction --- ts/views/conversation_view.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ts/views/conversation_view.ts b/ts/views/conversation_view.ts index 15b6407cd..71d4786ad 100644 --- a/ts/views/conversation_view.ts +++ b/ts/views/conversation_view.ts @@ -204,9 +204,6 @@ Whisper.TapToViewExpiredOutgoingToast = Whisper.ToastView.extend({ Whisper.DecryptionErrorToast = Whisper.ToastView.extend({ className: 'toast toast-clickable', - initialize() { - this.timeout = 10000; - }, events: { click: 'onClick', }, @@ -215,7 +212,20 @@ Whisper.DecryptionErrorToast = Whisper.ToastView.extend({ toastMessage: window.i18n('decryptionErrorToast'), }; }, + // Note: this is the same thing as ToastView, except it's missing the setTimeout, so it + // will stick around until the user interacts with it. + render() { + this.$el.html( + window.Mustache.render( + window._.result(this, 'template', ''), + window._.result(this, 'render_attributes', '') + ) + ); + this.$el.attr('tabIndex', 0); + this.$el.show(); + }, onClick() { + this.close(); window.showDebugLog(); }, });