Skip to content

Commit

Permalink
Fixed UI; Added backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvmisra committed Apr 28, 2020
1 parent 28e3111 commit ddfb499
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions js/firstscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,13 @@ enyo.kind({
if (name.length == 0) {
return;
}
this.step++;

if (util.getClientType() == constant.appType && (this.createnew || !this.$.server.getValue())) { // No password for the app when create new or server is null
this.step += 2;
this.displayStep();
} else if(!this.createnew) { // Login
this.step++;
} else if(this.createnew) {
} else { // Signup
this.checkUsername(name);
}
this.displayStep();
Expand Down Expand Up @@ -435,19 +438,29 @@ enyo.kind({
beforeSignup: true
},
function(inSender, inResponse) {
// Username is unique
if(!inResponse.exists) {
// Username unique
that.step++;
that.displayStep();
}
that.$.spinner.setShowing(false);
},
function(response, error) {
that.$.spinner.setShowing(false);
that.step--;
that.displayStep();
if (error == 22) {
that.$.warningmessage.setContent(l10n.get("UserAlreadyExist"));
if(error == 2) {
// Server does not support fix -> old workflow
that.step++;
that.displayStep();
} else {
that.$.warningmessage.setContent(l10n.get("ServerError", {code: error}));
// Server supports fix -> new workflow
if(error == 22) {
// Username already exists
that.$.warningmessage.setContent(l10n.get("UserAlreadyExist"));
} else {
that.$.warningmessage.setContent(l10n.get("ServerError", {code: error}));
}
that.$.warningmessage.setShowing(true);
}
that.$.warningmessage.setShowing(true);
that.$.spinner.setShowing(false);
}
);
},
Expand Down

0 comments on commit ddfb499

Please sign in to comment.