Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 9325917

Browse files
author
Nick Litwin
committed
Prevent the section from flickering
1 parent 56a2696 commit 9325917

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/settings/account-info/account-info.controller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
function activate() {
1818
vm.isSocialRegistrant = false;
19+
vm.loading = true;
1920

2021
vm.formProcessing = {
2122
accountInfoForm: false,
@@ -28,10 +29,12 @@
2829
UserService.getUserProfile({fields: 'credential'})
2930
.then(function(res) {
3031
vm.isSocialRegistrant = !res.credential.hasPassword;
32+
vm.loading = false;
3133
})
3234
.catch(function(err) {
3335
$log.error("Error fetching user profile. Redirecting to edit profile.");
3436
$state.go('settings.profile');
37+
vm.loading = false;
3538
});
3639

3740
vm.countries = ISO3166.getAllCountryObjects();

app/settings/account-info/account-info.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
.form-label Email
1212
input.form-field.grey(name="email", value="{{vm.userData.email}}", disabled=true)
1313

14-
div(ng-hide="vm.isSocialRegistrant")
14+
div(ng-if="!vm.isSocialRegistrant && !vm.loading")
1515
form(name="vm.newPasswordForm", role="form", ng-submit="vm.newPasswordForm.$valid && vm.submitNewPassword()", novalidate)
1616
.form-label Current password
1717

@@ -45,7 +45,7 @@
4545
button.tc-btn.save(type="submit", tc-busy-button, tc-busy-when="vm.formProcessing.newPasswordForm", ng-disabled="vm.newPasswordForm.$invalid || vm.newPasswordForm.$pristine", ng-class="{'disabled': vm.newPasswordForm.$invalid || vm.newPasswordForm.$pristine}") Change Password
4646

4747

48-
div(ng-show="vm.isSocialRegistrant")
48+
div(ng-if="vm.isSocialRegistrant && !vm.loading")
4949
p You joined Topcoder by using an external account, so we don't have a password for you.
5050

5151
form(name="vm.accountInfoForm", role="form", novalidate, autocomplete="off")

0 commit comments

Comments
 (0)