mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-03 19:11:22 +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) {
|
function moveChatAndHrToTop(roomEl) {
|
||||||
const hr = roomEl.next('hr');
|
const hr = roomEl.next('hr');
|
||||||
components.get('chat/recent').prepend(roomEl);
|
const recentChats = components.get('chat/recent');
|
||||||
if (hr.length) {
|
const chatCount = recentChats.find('[data-roomid]').length;
|
||||||
roomEl.after(hr);
|
recentChats.prepend(roomEl);
|
||||||
|
if (hr.length || chatCount > 1) {
|
||||||
|
roomEl.after(hr.length ? hr : `<hr class="my-1">`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user