Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
53b12399
Commit
53b12399
authored
6 years ago
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid inserting invalid dates and/or empty divs
parent
aac8b741
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/converse-chatview.js
src/converse-chatview.js
+7
-1
No files found.
src/converse-chatview.js
View file @
53b12399
...
@@ -536,6 +536,9 @@ converse.plugins.add('converse-chatview', {
...
@@ -536,6 +536,9 @@ converse.plugins.add('converse-chatview', {
prev_msg_date
=
_
.
isNull
(
prev_msg_el
)
?
null
:
prev_msg_el
.
getAttribute
(
'
data-isodate
'
),
prev_msg_date
=
_
.
isNull
(
prev_msg_el
)
?
null
:
prev_msg_el
.
getAttribute
(
'
data-isodate
'
),
next_msg_date
=
next_msg_el
.
getAttribute
(
'
data-isodate
'
);
next_msg_date
=
next_msg_el
.
getAttribute
(
'
data-isodate
'
);
if
(
_
.
isNull
(
prev_msg_date
)
&&
_
.
isNull
(
next_msg_date
))
{
return
;
}
if
(
_
.
isNull
(
prev_msg_date
)
||
moment
(
next_msg_date
).
isAfter
(
prev_msg_date
,
'
day
'
))
{
if
(
_
.
isNull
(
prev_msg_date
)
||
moment
(
next_msg_date
).
isAfter
(
prev_msg_date
,
'
day
'
))
{
const
day_date
=
moment
(
next_msg_date
).
startOf
(
'
day
'
);
const
day_date
=
moment
(
next_msg_date
).
startOf
(
'
day
'
);
next_msg_el
.
insertAdjacentHTML
(
'
beforeBegin
'
,
next_msg_el
.
insertAdjacentHTML
(
'
beforeBegin
'
,
...
@@ -726,6 +729,9 @@ converse.plugins.add('converse-chatview', {
...
@@ -726,6 +729,9 @@ converse.plugins.add('converse-chatview', {
const
view
=
new
_converse
.
MessageView
({
'
model
'
:
message
});
const
view
=
new
_converse
.
MessageView
({
'
model
'
:
message
});
await
view
.
render
();
await
view
.
render
();
if
(
!
view
.
el
.
innerHTML
)
{
return
_converse
.
log
(
"
showMessage: message's view element is empty
"
,
Strophe
.
LogLevel
.
ERROR
);
}
this
.
clearChatStateNotification
(
message
);
this
.
clearChatStateNotification
(
message
);
this
.
insertMessage
(
view
);
this
.
insertMessage
(
view
);
this
.
insertDayIndicator
(
view
.
el
);
this
.
insertDayIndicator
(
view
.
el
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment