| 21 | |
| 22 | export default class DecryptController extends SubController { |
| 23 | constructor(port) { |
| 24 | super(port); |
| 25 | if (!port) { |
| 26 | this.mainType = 'decryptCont'; |
| 27 | this.id = getUUID(); |
| 28 | } |
| 29 | this.state = { |
| 30 | popupId: null, |
| 31 | popupOpenerTabId: null |
| 32 | }; |
| 33 | this.armored = null; |
| 34 | this.message = null; |
| 35 | this.sender = null; |
| 36 | this.popup = null; |
| 37 | this.decryptReady = null; |
| 38 | this.reconnect = false; |
| 39 | // register event handlers |
| 40 | this.on('decrypt-dialog-cancel', this.dialogCancel); |
| 41 | this.on('decrypt-message-init', this.onDecryptMessageInit); |
| 42 | this.on('decrypt-message', this.onDecrypt); |
| 43 | this.on('dframe-display-popup', this.onDframeDisplayPopup); |
| 44 | this.on('set-armored', this.onSetArmored); |
| 45 | this.on('decrypt-inline-user-input', msg => uiLog.push(msg.source, msg.type)); |
| 46 | } |
| 47 | |
| 48 | async onDecryptMessageInit({reconnect}) { |
| 49 | this.reconnect = reconnect; |