@bcc-code/vue-bcc-chat-ui 1.2.0 → 1.2.1

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.
@@ -70473,26 +70473,26 @@ const qC = {
70473
70473
  };
70474
70474
  let Nu = {};
70475
70475
  const pI = oe([]), XFe = async (e) => (Nu[e] || (Nu[e] = await X.CometChat.getGroup(e)), Nu[e]), e$e = async () => {
70476
- let e = new X.CometChat.ConversationsRequestBuilder().setLimit(30).setConversationType("group").build(), t = [], n = [];
70476
+ let t = new X.CometChat.ConversationsRequestBuilder().setLimit(30).setConversationType("group").build(), n = [], o = [];
70477
70477
  do
70478
- n = await e.fetchNext(), t = t.concat(n);
70479
- while (n.length > 0);
70480
- const o = t.map((a) => {
70481
- const s = a.getLastMessage(), i = a.getUnreadMessageCount(), d = s.getType();
70478
+ o = await t.fetchNext(), n = n.concat(o);
70479
+ while (o.length == 30);
70480
+ const a = n.map((s) => {
70481
+ const i = s.getLastMessage(), d = s.getUnreadMessageCount(), u = i.getType();
70482
70482
  return {
70483
- chatUid: a.getConversationId().split("_")[1],
70484
- name: a.getConversationWith().getName(),
70483
+ chatUid: s.getConversationId().split("_")[1],
70484
+ name: s.getConversationWith().getName(),
70485
70485
  lastMessage: {
70486
- text: d === X.CometChat.MESSAGE_TYPE.TEXT ? s.getText() : d === X.CometChat.MESSAGE_TYPE.IMAGE || d === X.CometChat.MESSAGE_TYPE.VIDEO || d === X.CometChat.MESSAGE_TYPE.AUDIO || d === X.CometChat.MESSAGE_TYPE.FILE ? s.getAttachment().getName() : "",
70487
- type: s ? s.getType() : "",
70488
- senderName: s ? s.getSender().getName() : "",
70489
- sentAt: new Date(s ? s.getSentAt() : 0)
70486
+ text: u === X.CometChat.MESSAGE_TYPE.TEXT ? i.getText() : u === X.CometChat.MESSAGE_TYPE.IMAGE || u === X.CometChat.MESSAGE_TYPE.VIDEO || u === X.CometChat.MESSAGE_TYPE.AUDIO || u === X.CometChat.MESSAGE_TYPE.FILE ? i.getAttachment().getName() : "",
70487
+ type: i ? i.getType() : "",
70488
+ senderName: i ? i.getSender().getName() : "",
70489
+ sentAt: new Date(i ? i.getSentAt() * 1e3 : 0)
70490
70490
  },
70491
- tags: a.getTags(),
70492
- unreadMessageCount: i
70491
+ tags: s.getTags(),
70492
+ unreadMessageCount: isNaN(d) ? 0 : d
70493
70493
  };
70494
70494
  });
70495
- return pI.value = o, o;
70495
+ return pI.value = a, a;
70496
70496
  }, t$e = {
70497
70497
  getGroup: XFe,
70498
70498
  userChats: pI,
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": "1.2.0",
5
+ "version": "1.2.1",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [