This repository was archived by the owner on Mar 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/directives/challenge-user-place Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 44
44
45
45
function activate ( ) {
46
46
$scope . numImages = 0 ;
47
- if ( ! $scope . challenge . isPrivate && $scope . challenge . userDetails . submissions && $scope . challenge . userDetails . submissions . length > 0 ) {
48
- $scope . numImages = $scope . challenge . userDetails . submissions . filter ( function ( submission ) {
47
+ if ( $scope . challenge . userDetails && $scope . challenge . userDetails . submissions && $scope . challenge . userDetails . submissions . length > 0 ) {
48
+ $scope . challenge . userDetails . submissions = $scope . challenge . userDetails . submissions . filter ( function ( submission ) {
49
49
return submission && submission . submissionImage ;
50
- } ) . length ;
50
+ } ) ;
51
+ }
52
+ if ( ! $scope . challenge . isPrivate && $scope . challenge . userDetails && $scope . challenge . userDetails . submissions && $scope . challenge . userDetails . submissions . length > 0 ) {
53
+ $scope . numImages = $scope . challenge . userDetails . submissions . length ;
51
54
$scope . selectedIndex = 0 ;
52
55
$scope . challenge . thumbnailId = $scope . challenge . userDetails . submissions [ 0 ] . id ;
53
56
$scope . imageURL = $scope . challenge . userDetails . submissions [ 0 ] . submissionImage && $scope . challenge . userDetails . submissions [ 0 ] . submissionImage . full ;
You can’t perform that action at this time.
0 commit comments