From b5dffcfdfc07b74dfd685f50345594c45d7cd1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mu-An=20=E2=9C=8C=EF=B8=8F=20Chiou?= Date: Thu, 6 Sep 2018 13:44:20 -0400 Subject: [PATCH] Fix error on logged out homepage --- dashboard.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dashboard.js b/dashboard.js index 5852159..06fa1f6 100644 --- a/dashboard.js +++ b/dashboard.js @@ -106,15 +106,18 @@ function init () { details.appendChild(container) const newDashboard = document.querySelector('.page-responsive [data-src*="/dashboard/recent-activity"], .js-recent-activity-container') + const oldDashboard = document.querySelector('.news') if (newDashboard) { newDashboard.after(details) - } else { + } else if(oldDashboard) { // org or user condition summary.classList.remove('btn-sm') details.classList.add(context === 'org' ? 'mt-3' : 'mt-5') - document.querySelector('.news').prepend(details) + + oldDashboard.prepend(details) } - applyPreference() + + if (newDashboard || oldDashboard) applyPreference() } function rememberPreference () {