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","_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,OAAOC,eAAeC,EAAS,aAAc,CACzCC,OAAO,IAGX,IAAIC,EAAY,EAAQ,GAIpBC,EAAmBC,EAFD,EAAQ,IAM1BC,EAAmBD,EAFA,EAAQ,IAM3BE,EAAgBF,EAFA,EAAQ,IAMxBG,EAA8BH,EAFA,EAAQ,IAMtCI,EAAaJ,EAFA,EAAQ,IAMrBK,EAAUL,EAFD,EAAQ,IAMjBM,EAAcN,EAFD,EAAQ,IAMrBO,EAAUP,EAFD,EAAQ,IAMjBQ,EAAoBR,EAFD,EAAQ,KAM3BS,EAAeT,EAFD,EAAQ,KAItBU,EAAmB,EAAQ,GAI3BC,EAAUX,EAFD,EAAQ,KAIrB,SAASA,EAAuBY,GAAO,OAAOA,GAAOA,EAAIC,WAAaD,EAAM,CAAEE,QAASF,GAEvF,IAAIG,EAA0B,SAAUC,GAGpC,SAASD,IACL,IAAIE,EAEAC,EAAOC,EAAOC,GAElB,EAAInB,EAAiBa,SAASO,KAAMN,GAE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AAIrC,EAAiBuC,IAAI,qEAE7BE,EACA9C,EAAQS,QAAQiC,cAAcF,EAAe,CACzCU,eAAe,EAAI7C,EAAiBuC,IAAI,MACxCO,qBAAsBnC,KAAKW,UAC3ByB,cAAc,EAAI/C,EAAiBuC,IAAI,kBACvCS,SAAUrC,KAAKc,uBAIb9B,EAAQS,QAAQiC,cACtB,MACA,KACAG,EACAC,EACA9C,EAAQS,QAAQiC,cAAcF,EAAe,CACzCU,eAAe,EAAI7C,EAAiBuC,IAAI,0BACxCO,qBAAsBnC,KAAKiB,aAC3BmB,cAAc,EAAI/C,EAAiBuC,IAAI,kBACvCS,SAAUrC,KAAKc,uBAKpB9B,EAAQS,QAAQiC,cACnBH,EACA,CAAEI,UAAW,2BACTd,WAAYb,KAAKY,MAAMC,WACvBY,MAAOA,GAEXM,OAILrC,EA/FmB,CAgG5BV,EAAQS,QAAQ6C,eAgBlB5C,EAAwB6C,UAAY,CAEhCC,eAAgBvD,EAAYQ,QAAQgD,OACpC5B,WAAY5B,EAAYQ,QAAQiD,KAAKC,YAEzCpE,EAAQkB,QAAUC,EAClBkD,EAAOrE,QAAUA,EAAiB","file":"bundles/a6f8076a857e57b3741a/15.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":""}