Skip to content

Commit b5dffcf

Browse files
committed
Fix error on logged out homepage
1 parent deefd9f commit b5dffcf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

dashboard.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,18 @@ function init () {
106106
details.appendChild(container)
107107

108108
const newDashboard = document.querySelector('.page-responsive [data-src*="/dashboard/recent-activity"], .js-recent-activity-container')
109+
const oldDashboard = document.querySelector('.news')
109110
if (newDashboard) {
110111
newDashboard.after(details)
111-
} else {
112+
} else if(oldDashboard) {
112113
// org or user condition
113114
summary.classList.remove('btn-sm')
114115
details.classList.add(context === 'org' ? 'mt-3' : 'mt-5')
115-
document.querySelector('.news').prepend(details)
116+
117+
oldDashboard.prepend(details)
116118
}
117-
applyPreference()
119+
120+
if (newDashboard || oldDashboard) applyPreference()
118121
}
119122

120123
function rememberPreference () {

0 commit comments

Comments
 (0)