Use MatrixClientPeg::safeGet in src/components/views/* (#10987)

This commit is contained in:
Michael Telatynski 2023-06-15 08:46:19 +01:00 committed by GitHub
parent 4243847f4f
commit 280f6a9d93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 265 additions and 250 deletions

View file

@ -86,7 +86,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
private async fetchOpponentProfile(): Promise<void> {
try {
const prof = await MatrixClientPeg.get().getProfileInfo(this.props.verifier.userId);
const prof = await MatrixClientPeg.safeGet().getProfileInfo(this.props.verifier.userId);
this.setState({
opponentProfile: prof,
});
@ -143,7 +143,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
};
private renderPhaseStart(): ReactNode {
const isSelf = this.props.verifier.userId === MatrixClientPeg.get().getUserId();
const isSelf = this.props.verifier.userId === MatrixClientPeg.safeGet().getUserId();
let profile;
const oppProfile = this.state.opponentProfile;
@ -233,7 +233,7 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
sas={this.showSasEvent.sas}
onCancel={this.onCancelClick}
onDone={this.onSasMatchesClick}
isSelf={this.props.verifier.userId === MatrixClientPeg.get().getUserId()}
isSelf={this.props.verifier.userId === MatrixClientPeg.safeGet().getUserId()}
inDialog={true}
/>
);