fix avatar upload on signup

This commit is contained in:
or-else
2022-09-01 11:12:09 -07:00
parent ee106a17f6
commit d45a141704
12 changed files with 612 additions and 536 deletions
+8 -4
View File
@@ -1125,16 +1125,20 @@ class TinodeWeb extends React.Component {
this.handleError();
this.tinode.connect(this.state.serverAddress)
.then(() => {
.then(_ => {
let attachments;
if (public_ && public_.photo && public_.photo.ref) {
attachments = [public_.photo.ref];
}
return this.tinode.createAccountBasic(login_, password_,
{public: public_, tags: tags_, cred: Tinode.credential(cred_)});
}).then((ctrl) => {
{public: public_, tags: tags_, cred: Tinode.credential(cred_), attachments: attachments});
}).then(ctrl => {
if (ctrl.code >= 300 && ctrl.text == 'validate credentials') {
TinodeWeb.navigateToCredentialsView(ctrl.params);
} else {
this.handleLoginSuccessful(this);
}
}).catch((err) => {
}).catch(err => {
this.handleError(err.message, 'err');
});
}