Extract separate add / bind methods on AddThreepid

This commit is contained in:
J. Ryan Stinnett 2019-09-19 15:50:18 +01:00
parent 99b804d567
commit 9a1305bf4a
6 changed files with 45 additions and 17 deletions

View file

@ -78,7 +78,11 @@ export class PhoneNumber extends React.Component {
// a leading plus sign to a number in E.164 format (which the 3PID
// address is), but this goes against the spec.
// See https://github.com/matrix-org/matrix-doc/issues/2222
await task.addMsisdn(null, `+${address}`, bind);
if (bind) {
await task.bindMsisdn(null, `+${address}`);
} else {
await task.addMsisdn(null, `+${address}`);
}
this.setState({
continueDisabled: false,
bound: bind,