mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 11:01:20 +01:00
fix: if there is no hr create one
happens if its the only chat or if its the last one in the list
This commit is contained in:
@@ -670,9 +670,11 @@ define('forum/chats', [
|
||||
|
||||
function moveChatAndHrToTop(roomEl) {
|
||||
const hr = roomEl.next('hr');
|
||||
components.get('chat/recent').prepend(roomEl);
|
||||
if (hr.length) {
|
||||
roomEl.after(hr);
|
||||
const recentChats = components.get('chat/recent');
|
||||
const chatCount = recentChats.find('[data-roomid]').length;
|
||||
recentChats.prepend(roomEl);
|
||||
if (hr.length || chatCount > 1) {
|
||||
roomEl.after(hr.length ? hr : `<hr class="my-1">`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user