(msg)
| 42 | } |
| 43 | |
| 44 | async onOk(msg) { |
| 45 | try { |
| 46 | this.options.password = msg.password; |
| 47 | if (msg.cache != prefs.prefs.security.password_cache) { |
| 48 | // update pwd cache status |
| 49 | await prefs.update({security: {password_cache: msg.cache}}); |
| 50 | } |
| 51 | const key = await pwdCache.unlock(this.options); |
| 52 | this.receivedPortMsg = true; |
| 53 | this.closePopup(); |
| 54 | this.passwordRequest.resolve({key, password: this.options.password}); |
| 55 | } catch (err) { |
| 56 | if (err.code == 'WRONG_PASSWORD') { |
| 57 | this.ports.pwdDialog.emit('wrong-password'); |
| 58 | } else { |
| 59 | if (this.ports.dDialog) { |
| 60 | this.ports.dDialog.emit('error-message', {error: err.message}); |
| 61 | } |
| 62 | this.closePopup(); |
| 63 | this.passwordRequest.reject(err); |
| 64 | } |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | onCancel() { |
| 69 | this.receivedPortMsg = true; |
nothing calls this directly
no test coverage detected