Make decryption error toast stick around until interaction

This commit is contained in:
Scott Nonnenberg 2021-07-20 13:53:12 -07:00 committed by GitHub
parent bf6c0ce7c0
commit a05c3646b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();
},
});