@bcc-code/vue-bcc-chat-ui 5.4.2 → 5.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@bcc-code/vue-bcc-chat-ui",
3
3
  "author": "bcc-code",
4
4
  "license": "Apache-2.0",
5
- "version": "5.4.2",
5
+ "version": "5.4.5",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -114,14 +114,7 @@ watch([loggedIn, chat.onlineStatus, () => props.chatUid, chat.initialized, () =>
114
114
  localLoadMessageId.value = "";
115
115
  }
116
116
 
117
- if (offlineStore.getGroupMessages(_chatUid, {
118
- per_page: 1,
119
- affix: 'prepend'
120
- }).total === 0) {
121
- isChatMessagesEmpty.value = true;
122
- } else {
123
- isChatMessagesEmpty.value = false;
124
- }
117
+ isChatMessagesEmpty.value = false;
125
118
 
126
119
  if (chatGroup.value) {
127
120
 
@@ -136,12 +129,23 @@ watch([loggedIn, chat.onlineStatus, () => props.chatUid, chat.initialized, () =>
136
129
  }
137
130
  ])
138
131
 
132
+ // Allow some time for messages to load before displaying "no messages"
133
+ setTimeout(() => {
134
+ if (offlineStore.getGroupMessages(_chatUid, {
135
+ per_page: 1,
136
+ affix: 'prepend'
137
+ }).total === 0) {
138
+ isChatMessagesEmpty.value = true;
139
+ } else {
140
+ isChatMessagesEmpty.value = false;
141
+ }
142
+ }, 1500);
143
+
139
144
  if (!isChannel) {
140
145
  getGroupMembersInfo(_chatUid).then((participants) => groupMembers.value = participants);
141
146
  } else {
142
147
  groupMembers.value = [];
143
148
  }
144
-
145
149
  }
146
150
  await chat.clearGroupChatCount(props.chatUid);
147
151
  } else if (chatGroup.value) {
@@ -270,14 +274,6 @@ function closeScheduledMessage() {
270
274
 
271
275
  <template>
272
276
  <div class="bcc-chat-message-list-wrapper" :class="componentId">
273
- <!-- <div>
274
- <div>Connecting... <button @click="tryConnect(true)">[retry]</button></div>
275
- <div>Online status: {{chat.onlineStatus}}</div>
276
- <div>Online mode: {{chat.onlineMode}}</div>
277
- <div>Connected: {{chat.connected.value}}</div>
278
- <div>Connecting: {{chat.connecting.value}}</div>
279
- <div>CometChat: {{cometChatStatus}} <button @click="getCometChatStatus()">[refresh]</button></div>
280
- </div> -->
281
277
  <BccChatMessages v-if="chatGroup && !chatInstance.showScheduledMessagesChat" :chatGroup="chatGroup"
282
278
  :hide-deleted-messages="props.hideDeletedMessages" :chatUid="props.chatUid"></BccChatMessages>
283
279
  <BccScheduledMessages v-else-if="chatGroup && chatInstance.showScheduledMessagesChat"
@@ -298,7 +294,7 @@ function closeScheduledMessage() {
298
294
  <div v-else class="bcc-chat-message-list-offline">
299
295
  <span>Loading...</span>
300
296
  </div>
301
- <div v-if="isChatMessagesEmpty && chatGroup" class="bcc-chat-message-list-offline">
297
+ <div v-if="isChatMessagesEmpty && chatGroup" class="bcc-chat-message-list-offline pointer-events-none">
302
298
  <span>No messages have been sent yet</span>
303
299
  </div>
304
300
  </div>