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.

1 line
11 KiB

{"version":3,"sources":["node_modules/matrix-react-sdk/lib/async-components/views/dialogs/keybackup/NewRecoveryMethodDialog.js"],"names":["Object","defineProperty","exports","value","_bluebird","__webpack_require__","_getPrototypeOf2","_interopRequireDefault","_classCallCheck3","_createClass3","_possibleConstructorReturn3","_inherits3","_react2","_propTypes2","_index2","_MatrixClientPeg2","_dispatcher2","_languageHandler","_Modal2","obj","__esModule","default","NewRecoveryMethodDialog","_React$PureComponent","_ref","_temp","_this","_ret","this","_len","arguments","length","args","Array","_key","__proto__","call","apply","concat","onOkClick","props","onFinished","onGoToSettingsClick","dispatch","action","onSetupClick","method","RestoreKeyBackupDialog","getComponent","createTrackedDialog","key","BaseDialog","DialogButtons","title","createElement","className","_t","newMethodDetected","hackWarning","content","get","getKeyBackupEnabled","primaryButton","onPrimaryButtonClick","cancelButton","onCancel","PureComponent","propTypes","newVersionInfo","object","func","isRequired","module"],"mappings":"4FAEAA,OAAAC,eAAAC,EAAA,cACAC,OAAA,IAGA,IAAAC,EAAgBC,EAAQ,IAIxBC,EAAAC,EAFsBF,EAAQ,IAM9BG,EAAAD,EAFuBF,EAAQ,IAM/BI,EAAAF,EAFoBF,EAAQ,IAM5BK,EAAAH,EAFkCF,EAAQ,IAM1CM,EAAAJ,EAFiBF,EAAQ,IAMzBO,EAAAL,EAFaF,EAAQ,IAMrBQ,EAAAN,EAFiBF,EAAQ,IAMzBS,EAAAP,EAFaF,EAAQ,IAMrBU,EAAAR,EAFuBF,EAAQ,IAM/BW,EAAAT,EAFkBF,EAAQ,KAI1BY,EAAuBZ,EAAQ,GAI/Ba,EAAAX,EAFaF,EAAQ,KAIrB,SAAAE,EAAAY,GAAsC,OAAAA,KAAAC,WAAAD,EAAA,CAAuCE,QAAAF,GAE7E,IAAAG,EAAA,SAAAC,GAGA,SAAAD,IACA,IAAAE,EAEAC,EAAAC,EAAAC,GAEA,EAAAnB,EA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AiC,cAAAF,EAAA,CACAU,eAAA,EAAA7C,EAAAuC,IAAA,MACAO,qBAAAnC,KAAAW,UACAyB,cAAA,EAAA/C,EAAAuC,IAAA,kBACAS,SAAArC,KAAAc,uBAIA9B,EAAAS,QAAAiC,cACA,MACA,KACAG,EACAC,EACA9C,EAAAS,QAAAiC,cAAAF,EAAA,CACAU,eAAA,EAAA7C,EAAAuC,IAAA,0BACAO,qBAAAnC,KAAAiB,aACAmB,cAAA,EAAA/C,EAAAuC,IAAA,kBACAS,SAAArC,KAAAc,uBAKA9B,EAAAS,QAAAiC,cACAH,EACA,CAAiBI,UAAA,2BACjBd,WAAAb,KAAAY,MAAAC,WACAY,SAEAM,OAIArC,EA/FA,CAgGCV,EAAAS,QAAA6C,eAgBD5C,EAAA6C,UAAA,CAEAC,eAAAvD,EAAAQ,QAAAgD,OACA5B,WAAA5B,EAAAQ,QAAAiD,KAAAC,YAEArE,EAAAmB,QAAAC,EACAkD,EAAAtE,UAAA","file":"bundles/e9b8313cd5591059cfdc/13.js","sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _bluebird = require(\"bluebird\");\n\nvar _getPrototypeOf = require(\"babel-runtime/core-js/object/get-prototype-of\");\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = require(\"babel-runtime/helpers/classCallCheck\");\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require(\"babel-runtime/helpers/createClass\");\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require(\"babel-runtime/helpers/possibleConstructorReturn\");\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require(\"babel-runtime/helpers/inherits\");\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _index = require(\"../../../../index\");\n\nvar _index2 = _interopRequireDefault(_index);\n\nvar _MatrixClientPeg = require(\"../../../../MatrixClientPeg\");\n\nvar _MatrixClientPeg2 = _interopRequireDefault(_MatrixClientPeg);\n\nvar _dispatcher = require(\"../../../../dispatcher\");\n\nvar _dispatcher2 = _interopRequireDefault(_dispatcher);\n\nvar _languageHandler = require(\"../../../../languageHandler\");\n\nvar _Modal = require(\"../../../../Modal\");\n\nvar _Modal2 = _interopRequireDefault(_Modal);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar NewRecoveryMethodDialog = function (_React$PureComponent) {\n (0, _inherits3.default)(NewRecoveryMethodDialog, _React$PureComponent);\n\n function NewRecoveryMethodDialog() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck3.default)(this, NewRecoveryMethodDialog);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = NewRecoveryMethodDialog.__proto__ || (0, _getPrototypeOf2.default)(NewRecoveryMethodDialog)).call.apply(_ref, [this].concat(args))), _this), _this.onOkClick = function () {\n _this.props.onFinished();\n }, _this.onGoToSettingsClick = function () {\n _this.props.onFinished();\n _dispatcher2.default.dispatch({ action: 'view_user_settings' });\n }, _this.onSetupClick = (0, _bluebird.method)(function () {\n var RestoreKeyBackupDialog = _index2.default.getComponent('dialogs.keybackup.RestoreKeyBackupDialog');\n _Modal2.default.createTrackedDialog('Restore Backup', '', RestoreKeyBackupDialog, {\n onFinished: _this.props.onFinished\n });\n }), _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);\n }\n\n (0, _createClass3.default)(NewRecoveryMethodDialog, [{\n key: \"render\",\n value: function render() {\n var BaseDialog = _index2.default.getComponent(\"views.dialogs.BaseDialog\");\n var DialogButtons = _index2.default.getComponent(\"views.elements.DialogButtons\");\n\n var title = _react2.default.createElement(\n \"span\",\n { className: \"mx_KeyBackupFailedDialog_title\" },\n (0, _languageHandler._t)(\"New Recovery Method\")\n );\n\n var newMethodDetected = _react2.default.createElement(\n \"p\",\n null,\n (0, _languageHandler._t)(\"A new recovery passphrase and key for Secure \" + \"Messages have been detected.\")\n );\n\n var hackWarning = _react2.default.createElement(\n \"p\",\n { className: \"warning\" },\n (0, _languageHandler._t)(\"If you didn't set the new recovery method, an \" + \"attacker may be trying to access your account. \" + \"Change your account password and set a new recovery \" + \"method immediately in Settings.\")\n );\n\n var content = void 0;\n if (_MatrixClientPeg2.default.get().getKeyBackupEnabled()) {\n content = _react2.default.createElement(\n \"div\",\n null,\n newMethodDetected,\n _react2.default.createElement(\n \"p\",\n null,\n (0, _languageHandler._t)(\"This device is encrypting history using the new recovery method.\")\n ),\n hackWarning,\n _react2.default.createElement(DialogButtons, {\n primaryButton: (0, _languageHandler._t)(\"OK\"),\n onPrimaryButtonClick: this.onOkClick,\n cancelButton: (0, _languageHandler._t)(\"Go to Settings\"),\n onCancel: this.onGoToSettingsClick\n })\n );\n } else {\n content = _react2.default.createElement(\n \"div\",\n null,\n newMethodDetected,\n hackWarning,\n _react2.default.createElement(DialogButtons, {\n primaryButton: (0, _languageHandler._t)(\"Set up Secure Messages\"),\n onPrimaryButtonClick: this.onSetupClick,\n cancelButton: (0, _languageHandler._t)(\"Go to Settings\"),\n onCancel: this.onGoToSettingsClick\n })\n );\n }\n\n return _react2.default.createElement(\n BaseDialog,\n { className: \"mx_KeyBackupFailedDialog\",\n onFinished: this.props.onFinished,\n title: title\n },\n content\n );\n }\n }]);\n return NewRecoveryMethodDialog;\n}(_react2.default.PureComponent); /*\n Copyright 2018-2019 New Vector Ltd\n \n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n \n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\nNewRecoveryMethodDialog.propTypes = {\n // As returned by js-sdk getKeyBackupVersion()\n newVersionInfo: _propTypes2.default.object,\n onFinished: _propTypes2.default.func.isRequired\n};\nexports.default = NewRecoveryMethodDialog;\nmodule.exports = exports[\"default\"];\n//# sourceMappingURL=NewRecoveryMethodDialog.js.map"],"sourceRoot":""}