2020-07-14 23:21:25 +00:00
|
|
|
/* global Backbone, Signal, Whisper */
|
2018-07-07 00:48:14 +00:00
|
|
|
|
|
|
|
/* eslint-disable more/no-then */
|
|
|
|
|
|
|
|
// eslint-disable-next-line func-names
|
2018-04-27 21:25:04 +00:00
|
|
|
(function() {
|
|
|
|
window.Whisper = window.Whisper || {};
|
2015-02-27 02:10:04 +00:00
|
|
|
|
2018-04-27 21:25:04 +00:00
|
|
|
Whisper.KeyVerificationPanelView = Whisper.View.extend({
|
2020-06-26 00:08:58 +00:00
|
|
|
className: 'panel',
|
2018-04-27 21:25:04 +00:00
|
|
|
templateName: 'key-verification',
|
2018-07-07 00:48:14 +00:00
|
|
|
initialize(options) {
|
2019-08-09 23:35:09 +00:00
|
|
|
this.render();
|
|
|
|
|
2020-07-14 23:21:25 +00:00
|
|
|
this.view = new Whisper.ReactWrapperView({
|
2020-06-26 00:08:58 +00:00
|
|
|
JSX: Signal.State.Roots.createSafetyNumberViewer(window.reduxStore, {
|
|
|
|
contactID: options.model.get('id'),
|
|
|
|
}),
|
2020-07-02 20:33:31 +00:00
|
|
|
onInitialRender: () => {
|
|
|
|
if (options.onLoad) {
|
|
|
|
options.onLoad(this);
|
|
|
|
}
|
|
|
|
},
|
2018-07-07 00:48:14 +00:00
|
|
|
});
|
2017-06-10 19:18:24 +00:00
|
|
|
|
2020-07-14 23:21:25 +00:00
|
|
|
this.$('.key-verification-wrapper').append(this.view.el);
|
|
|
|
},
|
|
|
|
|
|
|
|
remove() {
|
|
|
|
if (this.view) {
|
|
|
|
this.view.remove();
|
|
|
|
}
|
|
|
|
Backbone.View.prototype.remove.call(this);
|
2018-04-27 21:25:04 +00:00
|
|
|
},
|
|
|
|
});
|
2015-02-27 02:10:04 +00:00
|
|
|
})();
|