Skip to content

Commit 09390fc

Browse files
nomo-kazzatladendo
authored andcommitted
update listings 2
Signed-off-by: Tom Ladendorf <[email protected]>
1 parent ffb0147 commit 09390fc

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

app/listings/listings.controller.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import _ from 'lodash'
21
import angular from 'angular'
3-
import { loadUser } from '../services/userv3.service.js'
2+
import { loadUser, getCurrentUser } from '../services/userv3.service.js'
43

54
(function () {
65
'use strict'
@@ -9,7 +8,7 @@ import { loadUser } from '../services/userv3.service.js'
98

109
ListingsCtrl.$inject = ['CONSTANTS', 'logger', '$q','TcAuthService', 'UserService',
1110
'UserStatsService', 'ProfileService', 'ChallengeService',
12-
'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope'
11+
'ExternalAccountService', 'ngDialog', '$anchorScroll', '$scope',
1312
]
1413

1514
function ListingsCtrl(CONSTANTS, logger, $q, TcAuthService, UserService, UserStatsService, ProfileService,
@@ -30,15 +29,10 @@ import { loadUser } from '../services/userv3.service.js'
3029
vm.myChallenges = []
3130
loadUser().then(function(token) {
3231
handle = UserService.getUserIdentity().handle
33-
// mock current user have this challenges
34-
vm.myChallenges.push({'id':30056409})
35-
vm.myChallenges.push({'id':30056067})
36-
vm.myChallenges.push({'id':16870})
3732

38-
// update auth flag
33+
// update auth flag and get challenges
3934
if(TcAuthService.isAuthenticated()) {
4035
getChallenges(handle)
41-
$scope.userProps = { isAuth: true, myChallenges: vm.myChallenges }
4236
}
4337
}, function(error) {
4438
// do nothing, just show non logged in state of navigation bar

0 commit comments

Comments
 (0)