-
-
Notifications
You must be signed in to change notification settings - Fork 828
Use new accessors for VerificationRequest
#11092
Conversation
d978ed6
to
ab18051
Compare
ab18051
to
e0779de
Compare
@@ -89,7 +89,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState> | |||
private onVerifyClick = (): void => { | |||
const cli = MatrixClientPeg.get(); | |||
const userId = cli.getSafeUserId(); | |||
const requestPromise = cli.requestVerification(userId); | |||
const requestPromise = cli.getCrypto()!.requestOwnUserVerification(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we assume that the crypto is defined here ?
Can we use instead cli.getCrypto()?.requestOwnUserVerification()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we assume that the crypto is defined here ?
Yes. I'm reasonably sure that SetupEncryptionBody
is only used when getCrypto
returns something -- and SetupEncryptionStore
(which is required for SetupEncryptionBody
) makes the same assumption.
Can we use instead cli.getCrypto()?.requestOwnUserVerification() ?
mmm; unfortunately I don't think it's as simple as that. VerificationRequestDialog
requires a (non-null) verificationRequestPromise
; we could add an if
statement and return instead of showing the dialog, but then we get into untestable code - and if the code is ever reachable then the UX is arguably just as bad as spamming an exception into the logs.
(Requires matrix-org/matrix-js-sdk#3474 -- now merged)
Fixes vector-im/crypto-internal#97. Fixes vector-im/crypto-internal#98.
This change is marked as an internal change (Task), so will not be included in the changelog.