@@ -1131,41 +1131,36 @@ class Threads {
1131
1131
}
1132
1132
1133
1133
_isDateDiffShown ( currentMsgId , lastMsgId , isNewMessage ) {
1134
- const messageIndex = this . threadsMessages . findIndex ( message => message . id == currentMsgId ) ;
1135
- if ( messageIndex == - 1 ) {
1136
- return false ;
1137
- }
1138
- const currentMsgDate = moment ( new Date ( this . threadsMessages [ messageIndex ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1139
-
1140
- // Check if this new message
1141
- // 1. Yes: this is new entered message.
1142
- // 2. No: Means this is came from API.
1143
- if ( isNewMessage ) {
1144
- // This in only one message.
1145
- if ( ! lastMsgId ) {
1146
- return true ;
1147
- }
1148
- const lastMsgIndex = this . threadsMessages . findIndex ( message => message . id == lastMsgId ) ;
1149
- if ( lastMsgIndex == - 1 ) {
1150
- return true ;
1151
- }
1152
- const lastMsgDate = moment ( new Date ( this . threadsMessages [ lastMsgIndex ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1153
- if ( currentMsgDate != lastMsgDate ) {
1154
- return true ;
1134
+ const messageIndex = this . threadsMessages . findIndex ( message => message . id == currentMsgId ) ;
1135
+ if ( messageIndex == - 1 ) {
1136
+ return false ;
1137
+ }
1138
+ const currentMsgDate = moment ( new Date ( this . threadsMessages [ messageIndex ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1139
+ if ( isNewMessage ) {
1140
+ // This in only one message.
1141
+ if ( ! lastMsgId ) {
1142
+ return true ;
1143
+ }
1144
+ const lastMsgIndex = this . threadsMessages . findIndex ( message => message . id == lastMsgId ) ;
1145
+ if ( lastMsgIndex == - 1 ) {
1146
+ return true ;
1147
+ }
1148
+ const lastMsgDate = moment ( new Date ( this . threadsMessages [ lastMsgIndex ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1149
+ if ( currentMsgDate != lastMsgDate ) {
1150
+ return true ;
1155
1151
}
1156
1152
return false ;
1157
- }
1153
+ }
1158
1154
1159
- if ( ! this . threadsMessages [ messageIndex + 1 ] ) {
1160
- return true ;
1161
- }
1155
+ if ( ! this . threadsMessages [ messageIndex + 1 ] ) {
1156
+ return true ;
1157
+ }
1162
1158
1163
- const nextMsgDate = moment ( new Date ( this . threadsMessages [ messageIndex + 1 ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1164
-
1165
- if ( currentMsgDate != nextMsgDate ) {
1166
- return true ;
1167
- }
1168
- return false ;
1159
+ const nextMsgDate = moment ( new Date ( this . threadsMessages [ messageIndex + 1 ] . createdAt ) ) . format ( 'DD/MM/YYYY' ) ;
1160
+ if ( currentMsgDate != nextMsgDate ) {
1161
+ return true ;
1162
+ }
1163
+ return false ;
1169
1164
}
1170
1165
1171
1166
_createMessageBubble ( message , messagesBox , showDateDiff = true , isNewMessage = false , isPendingMessage = false ) {
0 commit comments