diff --git a/app/assets/javascripts/initializers/initScrolling.js b/app/assets/javascripts/initializers/initScrolling.js index b330bc698..c70dbf0cd 100644 --- a/app/assets/javascripts/initializers/initScrolling.js +++ b/app/assets/javascripts/initializers/initScrolling.js @@ -43,7 +43,7 @@ function fetchNext(el, endpoint, insertCallback) { } function insertNext(params, buildCallback) { - return function insertEntries(entries) { + return function insertEntries(entries = []) { var list = document.getElementById(params.listId || 'sublist'); var newFollowersHTML = ''; entries.forEach(function insertAnEntry(entry) { @@ -57,7 +57,9 @@ function insertNext(params, buildCallback) { }); var followList = document.getElementById('following-wrapper'); - followList.insertAdjacentHTML('beforeend', newFollowersHTML); + if (followList) { + followList.insertAdjacentHTML('beforeend', newFollowersHTML); + } if (nextPage > 0) { fetching = false; } diff --git a/app/views/dashboards/_actions.html.erb b/app/views/dashboards/_actions.html.erb index ec1a00d19..40a770a77 100644 --- a/app/views/dashboards/_actions.html.erb +++ b/app/views/dashboards/_actions.html.erb @@ -1,35 +1,49 @@ -