You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Convert haveMsisdnToken to async / await
This commit is contained in:
@@ -108,19 +108,19 @@ export default class AddThreepid {
|
|||||||
* with a "message" property which contains a human-readable message detailing why
|
* with a "message" property which contains a human-readable message detailing why
|
||||||
* the request failed.
|
* the request failed.
|
||||||
*/
|
*/
|
||||||
haveMsisdnToken(token) {
|
async haveMsisdnToken(token) {
|
||||||
return MatrixClientPeg.get().submitMsisdnToken(
|
const result = await MatrixClientPeg.get().submitMsisdnToken(
|
||||||
this.sessionId, this.clientSecret, token,
|
this.sessionId, this.clientSecret, token,
|
||||||
).then((result) => {
|
);
|
||||||
if (result.errcode) {
|
if (result.errcode) {
|
||||||
throw result;
|
throw result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const identityServerDomain = MatrixClientPeg.get().idBaseUrl.split("://")[1];
|
const identityServerDomain = MatrixClientPeg.get().idBaseUrl.split("://")[1];
|
||||||
return MatrixClientPeg.get().addThreePid({
|
return MatrixClientPeg.get().addThreePid({
|
||||||
sid: this.sessionId,
|
sid: this.sessionId,
|
||||||
client_secret: this.clientSecret,
|
client_secret: this.clientSecret,
|
||||||
id_server: identityServerDomain,
|
id_server: identityServerDomain,
|
||||||
}, this.bind);
|
}, this.bind);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user