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

Commit 46aa1ef

Browse files
author
Parth Shah
committed
fixing tracks & empty state
1 parent 29a48f8 commit 46aa1ef

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.13
1+
v1.0.14

app/directives/profile-widget/profile-widget.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| Member Since {{profile.startMonth}}
1515

1616
a.tc-btn.tc-btn-s.edit(ng-show="editProfileLink", ui-sref="settings.profile") Edit Profile
17-
17+
1818
.tracks-links(ng-if="profile.tracks && profile.tracks.length > 0")
1919
.tracks
2020
.track(ng-repeat="track in (profile.tracks)", ng-click="profileVm.scrollTo(track)")

app/profile/about/about.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
vm.categories = profileVm.categories;
6262
vm.marathonRating = profileVm.categories['MARATHON_MATCH'] && profileVm.categories['MARATHON_MATCH'].rating;
6363
vm.SRMRating = profileVm.categories['SRM'] && profileVm.categories['SRM'].rating;
64-
vm.displaySection.stats = profileVm.showEditProfileLink || vm.categories.DESIGN.length || vm.categories.DEVELOP.length || vm.categories.DATA_SCIENCE.length || vm.categories.COPILOT.length;
64+
vm.displaySection.stats = profileVm.showEditProfileLink || _.get(vm, 'categories.DESIGN', []).length || _.get(vm, 'categories.DEVELOP', []).length || _.get(vm, 'categories.DATA_SCIENCE', []).length || _.get(vm, 'categories.COPILOT', []).length;
6565
});
6666

6767
profileVm.skillsPromise.then(function() {

app/profile/about/about.jade

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
profile-widget(profile="profileVm.profile", edit-profile-link="profileVm.showEditProfileLink", num-wins="profileVm.numWins", profile-vm="profileVm")
66
77
//- .sticky-container(bs-affix data-offset-top="10" data-offset-bottom="400")
8-
.sticky-container()
8+
.sticky-container
99
profile-widget(profile="profileVm.profile", edit-profile-link="profileVm.showEditProfileLink", num-wins="profileVm.numWins", profile-vm="profileVm")
1010

1111
.profile-about-container
1212

1313
.empty-profile
1414
.empty-state
15-
empty-state-placeholder(state-name="profile-empty", show="!profileVm.showEditProfileLink && !profileVm.numProjects && (!profileVm.skills || (profileVm.skills && profileVm.skills.length == 0)) && !vm.hasLinks")
15+
empty-state-placeholder(state-name="profile-empty", show="profileVm.status.skills === 'ready' && profileVm.status.stats === 'ready' && profileVm.status.externalLinks === 'ready' && !profileVm.showEditProfileLink && !profileVm.numProjects && (!profileVm.skills || (profileVm.skills && profileVm.skills.length == 0)) && !vm.hasLinks")
1616
.sample-image
1717
img(ng-src="/images/robot.svg")
1818

app/profile/profile.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
vm.statsPromise = ProfileService.getUserStats(vm.userHandle).then(function(stats) {
3939
if (stats) {
4040
vm.stats = stats;
41-
vm.profile.tracks = vm.profile.tracks || ProfileService.getTracks(vm.stats) || [];
41+
vm.profile.tracks = vm.profile.tracks || [];
4242
if (stats.COPILOT && stats.COPILOT.contests && vm.profile.tracks.indexOf('COPILOT') == -1) {
4343
vm.profile.tracks.push('COPILOT');
4444
}
@@ -47,10 +47,10 @@
4747
vm.categories = ProfileService.getRanks(vm.stats);
4848
} else {
4949
vm.stats = false;
50-
vm.profile.tracks = [];
50+
// vm.profile.tracks = [];
5151
vm.numProjects = 0;
5252
vm.numWins = 0;
53-
vm.categories = [];
53+
vm.categories = {};
5454
}
5555
vm.status.stats = CONSTANTS.STATE_READY;
5656
return vm.stats;

0 commit comments

Comments
 (0)