You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-10-31 01:45:39 +03:00 
			
		
		
		
	Apply prettier formatting
This commit is contained in:
		| @@ -18,7 +18,7 @@ limitations under the License. | ||||
| import React from "react"; | ||||
| import { IKeyBackupInfo } from "matrix-js-sdk/src/crypto/keybackup"; | ||||
|  | ||||
| import { MatrixClientPeg } from '../../../../MatrixClientPeg'; | ||||
| import { MatrixClientPeg } from "../../../../MatrixClientPeg"; | ||||
| import dis from "../../../../dispatcher/dispatcher"; | ||||
| import { _t } from "../../../../languageHandler"; | ||||
| import Modal from "../../../../Modal"; | ||||
| @@ -43,61 +43,66 @@ export default class NewRecoveryMethodDialog extends React.PureComponent<IProps> | ||||
|     }; | ||||
|  | ||||
|     private onSetupClick = async (): Promise<void> => { | ||||
|         Modal.createDialog(RestoreKeyBackupDialog, { | ||||
|             onFinished: this.props.onFinished, | ||||
|         }, null, /* priority = */ false, /* static = */ true); | ||||
|         Modal.createDialog( | ||||
|             RestoreKeyBackupDialog, | ||||
|             { | ||||
|                 onFinished: this.props.onFinished, | ||||
|             }, | ||||
|             null, | ||||
|             /* priority = */ false, | ||||
|             /* static = */ true, | ||||
|         ); | ||||
|     }; | ||||
|  | ||||
|     public render(): JSX.Element { | ||||
|         const title = <span className="mx_KeyBackupFailedDialog_title"> | ||||
|             { _t("New Recovery Method") } | ||||
|         </span>; | ||||
|         const title = <span className="mx_KeyBackupFailedDialog_title">{_t("New Recovery Method")}</span>; | ||||
|  | ||||
|         const newMethodDetected = <p>{ _t( | ||||
|             "A new Security Phrase and key for Secure Messages have been detected.", | ||||
|         ) }</p>; | ||||
|         const newMethodDetected = <p>{_t("A new Security Phrase and key for Secure Messages have been detected.")}</p>; | ||||
|  | ||||
|         const hackWarning = <p className="warning">{ _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.", | ||||
|         ) }</p>; | ||||
|         const hackWarning = ( | ||||
|             <p className="warning"> | ||||
|                 {_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.", | ||||
|                 )} | ||||
|             </p> | ||||
|         ); | ||||
|  | ||||
|         let content; | ||||
|         if (MatrixClientPeg.get().getKeyBackupEnabled()) { | ||||
|             content = <div> | ||||
|                 { newMethodDetected } | ||||
|                 <p>{ _t( | ||||
|                     "This session is encrypting history using the new recovery method.", | ||||
|                 ) }</p> | ||||
|                 { hackWarning } | ||||
|                 <DialogButtons | ||||
|                     primaryButton={_t("OK")} | ||||
|                     onPrimaryButtonClick={this.onOkClick} | ||||
|                     cancelButton={_t("Go to Settings")} | ||||
|                     onCancel={this.onGoToSettingsClick} | ||||
|                 /> | ||||
|             </div>; | ||||
|             content = ( | ||||
|                 <div> | ||||
|                     {newMethodDetected} | ||||
|                     <p>{_t("This session is encrypting history using the new recovery method.")}</p> | ||||
|                     {hackWarning} | ||||
|                     <DialogButtons | ||||
|                         primaryButton={_t("OK")} | ||||
|                         onPrimaryButtonClick={this.onOkClick} | ||||
|                         cancelButton={_t("Go to Settings")} | ||||
|                         onCancel={this.onGoToSettingsClick} | ||||
|                     /> | ||||
|                 </div> | ||||
|             ); | ||||
|         } else { | ||||
|             content = <div> | ||||
|                 { newMethodDetected } | ||||
|                 { hackWarning } | ||||
|                 <DialogButtons | ||||
|                     primaryButton={_t("Set up Secure Messages")} | ||||
|                     onPrimaryButtonClick={this.onSetupClick} | ||||
|                     cancelButton={_t("Go to Settings")} | ||||
|                     onCancel={this.onGoToSettingsClick} | ||||
|                 /> | ||||
|             </div>; | ||||
|             content = ( | ||||
|                 <div> | ||||
|                     {newMethodDetected} | ||||
|                     {hackWarning} | ||||
|                     <DialogButtons | ||||
|                         primaryButton={_t("Set up Secure Messages")} | ||||
|                         onPrimaryButtonClick={this.onSetupClick} | ||||
|                         cancelButton={_t("Go to Settings")} | ||||
|                         onCancel={this.onGoToSettingsClick} | ||||
|                     /> | ||||
|                 </div> | ||||
|             ); | ||||
|         } | ||||
|  | ||||
|         return ( | ||||
|             <BaseDialog className="mx_KeyBackupFailedDialog" | ||||
|                 onFinished={this.props.onFinished} | ||||
|                 title={title} | ||||
|             > | ||||
|                 { content } | ||||
|             <BaseDialog className="mx_KeyBackupFailedDialog" onFinished={this.props.onFinished} title={title}> | ||||
|                 {content} | ||||
|             </BaseDialog> | ||||
|         ); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user