Use MatrixClientPeg::safeGet for strict typing (#10989)
This commit is contained in:
parent
d64018ce26
commit
9b5b053148
60 changed files with 225 additions and 203 deletions
|
@ -51,7 +51,7 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||
}
|
||||
|
||||
public componentDidMount(): void {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
cli.on(ClientEvent.AccountData, this.onAccountData);
|
||||
cli.on(CryptoEvent.UserTrustStatusChanged, this.onStatusChanged);
|
||||
cli.on(CryptoEvent.KeysChanged, this.onStatusChanged);
|
||||
|
@ -89,7 +89,7 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||
};
|
||||
|
||||
private async getUpdatedStatus(): Promise<void> {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
const crypto = cli.getCrypto();
|
||||
if (!crypto) return;
|
||||
|
||||
|
@ -127,7 +127,7 @@ export default class CrossSigningPanel extends React.PureComponent<{}, IState> {
|
|||
private bootstrapCrossSigning = async ({ forceReset = false }): Promise<void> => {
|
||||
this.setState({ error: undefined });
|
||||
try {
|
||||
const cli = MatrixClientPeg.get();
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
await cli.bootstrapCrossSigning({
|
||||
authUploadDeviceSigningKeys: async (makeRequest): Promise<void> => {
|
||||
const { finished } = Modal.createDialog(InteractiveAuthDialog, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue