You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3 lines
15 KiB
3 lines
15 KiB
6 years ago
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{1081:function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},231:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=h(a(49)),s=h(a(14)),r=a(10),o=h(a(0)),l=h(a(5)),i=h(a(9)),u=a(543),c=h(a(534)),d=a(2);function h(e){return e&&e.__esModule?e:{default:e}}var p=0,f=5;t.default=o.default.createClass({displayName:"CreateKeyBackupDialog",getInitialState:function(){return{phase:p,passPhrase:"",passPhraseConfirm:"",copied:!1,downloaded:!1,zxcvbnResult:null,setPassPhrase:!1}},componentWillMount:function(){this._recoveryKeyNode=null,this._keyBackupInfo=null,this._setZxcvbnResultTimeout=null},componentWillUnmount:function(){null!==this._setZxcvbnResultTimeout&&clearTimeout(this._setZxcvbnResultTimeout)},_collectRecoveryKeyNode:function(e){this._recoveryKeyNode=e},_onCopyClick:function(){!function(e){var t=document.createRange();t.selectNodeContents(e);var a=window.getSelection();a.removeAllRanges(),a.addRange(t)}(this._recoveryKeyNode),document.execCommand("copy")&&this.setState({copied:!0,phase:3})},_onDownloadClick:function(){var e=new Blob([this._keyBackupInfo.recovery_key],{type:"text/plain;charset=us-ascii"});c.default.saveAs(e,"recovery-key.txt"),this.setState({downloaded:!0,phase:3})},_createBackup:function(){var e=(0,r.coroutine)(s.default.mark(function e(){var t;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.setState({phase:4,error:null}),t=void 0,e.prev=2,e.next=5,(0,r.resolve)(i.default.get().createKeyBackupVersion(this._keyBackupInfo));case 5:return t=e.sent,e.next=8,(0,r.resolve)(i.default.get().scheduleAllGroupSessionsForBackup());case 8:this.setState({phase:f}),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(2),console.log("Error creating key backup",e.t0),t&&i.default.get().deleteKeyBackupVersion(t.version),this.setState({error:e.t0});case 16:case"end":return e.stop()}},e,this,[[2,11]])}));return function(){return e.apply(this,arguments)}}(),_onCancel:function(){this.props.onFinished(!1)},_onDone:function(){this.props.onFinished(!0)},_onOptOutClick:function(){this.setState({phase:6})},_onSetUpClick:function(){this.setState({phase:p})},_onSkipPassPhraseClick:function(){var e=(0,r.coroutine)(s.default.mark(function e(){return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,r.resolve)(i.default.get().prepareKeyBackupVersion());case 2:this._keyBackupInfo=e.sent,this.setState({copied:!1,downloaded:!1,phase:2});case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),_onPassPhraseNextClick:function(){this.setState({phase:1})},_onPassPhraseKeyPress:function(){var e=(0,r.coroutine)(s.default.mark(function e(t){var a=this;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("Enter"!==t.key){e.next=7;break}if(null===this._setZxcvbnResultTimeout){e.next=6;break}return clearTimeout(this._setZxcvbnResultTimeout),this._setZxcvbnResultTimeout=null,e.next=6,(0,r.resolve)(new n.default(function(e){a.setState({zxcvbnResult:(0,u.scorePassword)(a.state.passPhrase)},e)}));case 6:this._passPhraseIsValid()&&this._onPassPhraseNextClick();case 7:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),_onPassPhraseConfirmNextClick:function(){var e=(0,r.coroutine)(s.default.mark(function e(){return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,r.resolve)(i.default.get().prepareKeyBackupVersion(this.state.passPhrase));case 2:this._keyBackupInfo=e.sent,this.setState({setPassPhrase:!0,copied:!1,downloaded:!1,phase:2});case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),_onPassPhraseConfirmKeyPress:function(e){"Enter"===e.key&&this.state.passPhrase===this.state.passPhraseConfirm&&this._onPassPhraseConfirmNextClick()},_onSetAgainClick:function(){this.setState({passPhrase:"",passPhraseConfirm:"",phase:p,zxcvbnResult:null})},_onKeepItSafeBackClick:function(){this.setState({phase:2})},
|
||
|
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=s:null!==a(1081)&&null!==a(542)&&(void 0===(n=function(){return s}.call(t,a,t,e))||(e.exports=n))}}]);
|
||
6 years ago
|
//# sourceMappingURL=1.js.map
|