Use MatrixClientPeg::safeGet in src/components/views/* (#10987)
This commit is contained in:
parent
4243847f4f
commit
280f6a9d93
81 changed files with 265 additions and 250 deletions
|
@ -125,7 +125,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
|||
// XXX: this should be returning a promise to maintain the state inside the state machine correct
|
||||
// but given that a deactivation is followed by a local logout and all object instances being thrown away
|
||||
// this isn't done.
|
||||
MatrixClientPeg.get()
|
||||
MatrixClientPeg.safeGet()
|
||||
.deactivateAccount(auth, this.state.shouldErase)
|
||||
.then((r) => {
|
||||
// Deactivation worked - logout & close this dialog
|
||||
|
@ -158,7 +158,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
|||
}
|
||||
|
||||
private initAuth(shouldErase: boolean): void {
|
||||
MatrixClientPeg.get()
|
||||
MatrixClientPeg.safeGet()
|
||||
.deactivateAccount(null, shouldErase)
|
||||
.then((r) => {
|
||||
// If we got here, oops. The server didn't require any auth.
|
||||
|
@ -190,7 +190,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
|||
<div>
|
||||
{this.state.bodyText}
|
||||
<InteractiveAuth
|
||||
matrixClient={MatrixClientPeg.get()}
|
||||
matrixClient={MatrixClientPeg.safeGet()}
|
||||
authData={this.state.authData}
|
||||
// XXX: onUIAuthComplete breaches the expected method contract, it gets away with it because it
|
||||
// knows the entire app is about to die as a result of the account deactivation.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue