Remove dead & duplicated code (#11405)
* Remove dead code * Make dead code happier * DRY pickle additional data calculation * Iterate
This commit is contained in:
parent
672ad98ec7
commit
27d79458da
25 changed files with 50 additions and 201 deletions
|
@ -281,16 +281,15 @@ export default class AddThreepid {
|
|||
): Promise<[success?: boolean, result?: IAuthData | Error | null] | undefined> {
|
||||
const authClient = new IdentityAuthClient();
|
||||
|
||||
let result: { success: boolean } | MatrixError;
|
||||
if (this.submitUrl) {
|
||||
result = await this.matrixClient.submitMsisdnTokenOtherUrl(
|
||||
await this.matrixClient.submitMsisdnTokenOtherUrl(
|
||||
this.submitUrl,
|
||||
this.sessionId!,
|
||||
this.clientSecret,
|
||||
msisdnToken,
|
||||
);
|
||||
} else if (this.bind) {
|
||||
result = await this.matrixClient.submitMsisdnToken(
|
||||
await this.matrixClient.submitMsisdnToken(
|
||||
this.sessionId!,
|
||||
this.clientSecret,
|
||||
msisdnToken,
|
||||
|
@ -299,9 +298,6 @@ export default class AddThreepid {
|
|||
} else {
|
||||
throw new UserFriendlyError("The add / bind with MSISDN flow is misconfigured");
|
||||
}
|
||||
if (result instanceof Error) {
|
||||
throw result;
|
||||
}
|
||||
|
||||
if (this.bind) {
|
||||
await this.matrixClient.bindThreePid({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue