Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/public/js/profile/profileCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.controller('ProfileCtrl', function (
SCapiService.getProfile(userId)
.then(function(data) {
$scope.profile_data = data;
$scope.profile_data.description = data.description.replace(/\n/g, '<br>') || '';
$scope.profile_data.description = data.description && data.description.replace(/\n/g, '<br>') || '';
$scope.followers_count = numberWithCommas(data.followers_count);
}, function(error) {
console.log('error', error);
Expand Down Expand Up @@ -70,7 +70,9 @@ app.controller('ProfileCtrl', function (
}
utilsService.updateTracksReposts(data.collection, true);
}, function(error) {
console.log('error', error);
if (error != 'No next page URL'){ // not a real error
console.log('error', error);
}
}).finally(function(){
$scope.busy = false;
$rootScope.isLoading = false;
Expand Down
6 changes: 4 additions & 2 deletions app/public/js/search/searchInputCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ app.controller('SearchInputCtrl', function ($scope, $http, $state, $window, SCap
title.innerHTML = 'Artists';
artists.appendChild(title);

for(var i = 0; i < 4; i++) {
// May not actually be 4 tracks long
for(var i = 0; i < data.collection.length; i++) {
var child = document.createElement('div');
child.className = 'dropdown-item';
child.id = data.collection[i].id;
Expand Down Expand Up @@ -80,7 +81,8 @@ app.controller('SearchInputCtrl', function ($scope, $http, $state, $window, SCap
title.innerHTML = 'Tracks';
tracks.appendChild(title);

for(var i = 0; i < 4; i++) {
// May not actually be 4 tracks long
for(var i = 0; i < data.collection.length; i++) {
var child = document.createElement('div');
var image = data.collection[i].artwork_url || 'public/img/song-placeholder.png';
child.className = 'dropdown-item';
Expand Down
4 changes: 3 additions & 1 deletion app/views/followers/followers.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ <h1> {{ ::title }}</h1>
</div>

<section class="songList_item_inner">
<h3 class="songList_item_song_tit selectable-text">{{ data.username }}</h3>
<a ui-sref="profile({id: {{data.id}}})">
<h3 class="songList_item_song_tit selectable-text">{{ data.username }}</h3>
</a>
<h4 class="songList_item_song_user">Tracks: {{ data.track_count }}</h4>
</section>

Expand Down
4 changes: 3 additions & 1 deletion app/views/following/following.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ <h1> {{ ::title }}</h1>
</div>

<section class="songList_item_inner">
<h3 class="songList_item_song_tit selectable-text">{{ data.username }}</h3>
<a ui-sref="profile({id: {{data.id}}})">
<h3 class="songList_item_song_tit selectable-text">{{ data.username }}</h3>
</a>
<h4 class="songList_item_song_user">Tracks: {{ data.track_count }}</h4>
</section>

Expand Down