Handle case where chat content is empty
This commit is contained in:
parent
1443fdd447
commit
cbe6092c33
@ -1429,11 +1429,11 @@
|
||||
showLeaveNotification (occupant) {
|
||||
const nick = occupant.get('nick'),
|
||||
stat = occupant.get('status'),
|
||||
last_el = this.content.lastElementChild,
|
||||
last_msg_date = last_el.getAttribute('data-isodate');
|
||||
last_el = this.content.lastElementChild;
|
||||
|
||||
if (_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
|
||||
moment(last_msg_date).isSame(new Date(), "day") &&
|
||||
if (last_el &&
|
||||
_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
|
||||
moment(last_el.getAttribute('data-isodate')).isSame(new Date(), "day") &&
|
||||
_.get(last_el, 'dataset', {}).join === `"${nick}"`) {
|
||||
|
||||
let message;
|
||||
@ -1462,7 +1462,8 @@
|
||||
'extra_classes': 'chat-event',
|
||||
'data': `data-leave="${nick}"`
|
||||
}
|
||||
if (_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
|
||||
if (last_el &&
|
||||
_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
|
||||
_.get(last_el, 'dataset', {}).leavejoin === `"${nick}"`) {
|
||||
|
||||
last_el.outerHTML = tpl_info(data);
|
||||
|
Loading…
Reference in New Issue
Block a user