Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve experience when discovering identity key error on send
New experience in the Message Detail view when outgoing identity key errors happen, matching the Android View. 'View' button is only shown on outgoing key errors right now. When a contact with an outgoing identity key error is clicked, they are taken to a view like the popup that comes up on Android: an explanation of what happened and three options: 'Show Safety Number', 'Send Anyway', and 'Cancel' Contacts are now sorted alphabetically, with the set of contacts with errors coming before the rest. FREEBIE
- Loading branch information
1 parent
b6cca41
commit 1291430
Showing
9 changed files
with
270 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* vim: ts=4:sw=4:expandtab | ||
*/ | ||
(function () { | ||
'use strict'; | ||
window.Whisper = window.Whisper || {}; | ||
|
||
Whisper.IdentityKeySendErrorPanelView = Whisper.View.extend({ | ||
className: 'identity-key-send-error panel', | ||
templateName: 'identity-key-send-error', | ||
initialize: function(options) { | ||
this.listenBack = options.listenBack; | ||
this.resetPanel = options.resetPanel; | ||
|
||
this.wasUnverified = this.model.isUnverified(); | ||
this.listenTo(this.model, 'change', this.render); | ||
}, | ||
events: { | ||
'click .show-safety-number': 'showSafetyNumber', | ||
'click .send-anyway': 'sendAnyway', | ||
'click .cancel': 'cancel' | ||
}, | ||
showSafetyNumber: function() { | ||
var view = new Whisper.KeyVerificationPanelView({ | ||
model: this.model | ||
}); | ||
this.listenBack(view); | ||
}, | ||
sendAnyway: function() { | ||
this.resetPanel(); | ||
this.trigger('send-anyway'); | ||
}, | ||
cancel: function() { | ||
this.resetPanel(); | ||
}, | ||
render_attributes: function() { | ||
var send = i18n('sendAnyway'); | ||
if (this.wasUnverified && !this.model.isUnverified()) { | ||
send = i18n('resend'); | ||
} | ||
|
||
var errorExplanation = i18n('identityKeyErrorOnSend', this.model.getTitle(), this.model.getTitle()); | ||
return { | ||
errorExplanation : errorExplanation, | ||
showSafetyNumber : i18n('showSafetyNumber'), | ||
sendAnyway : send, | ||
cancel : i18n('cancel') | ||
}; | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.