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

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,
@@ -70633,6 +70633,7 @@ const pI = oe([]), XFe = async (e) => (Nu[e] || (Nu[e] = await X.CometChat.getGr
70633
70633
  }
70634
70634
  });
70635
70635
  d.value = new Ce.MessageListConfiguration({
70636
+ scrollToBottomOnNewMessages: !0,
70636
70637
  templates: M
70637
70638
  });
70638
70639
  };
@@ -70640,6 +70641,7 @@ const pI = oe([]), XFe = async (e) => (Nu[e] || (Nu[e] = await X.CometChat.getGr
70640
70641
  o.value ? (w(), gt(Eve(zl), {
70641
70642
  key: 0,
70642
70643
  hideMessageHeader: !0,
70644
+ disableSoundForMessages: !0,
70643
70645
  messageComposerConfiguration: u.value,
70644
70646
  messageListConfiguration: d.value,
70645
70647
  hideMessageComposer: !1,
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.2",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -103,7 +103,7 @@ const initTemplates = () => {
103
103
  };
104
104
 
105
105
  messageListConfiguration.value = new MessageListConfiguration({
106
-
106
+ scrollToBottomOnNewMessages: true,
107
107
  templates: definedTemplates,
108
108
  });
109
109
  }
@@ -112,7 +112,7 @@ const initTemplates = () => {
112
112
 
113
113
  <template>
114
114
  <div v-if="chatGroup" class="bcc-chat-message-list">
115
- <CometChatMessages v-if="chatGroup" :hideMessageHeader="true" :messageComposerConfiguration="messageComposerConfiguration" :messageListConfiguration="messageListConfiguration" :hideMessageComposer="false" :hideDetails="true" :group="chatGroup"></CometChatMessages>
115
+ <CometChatMessages v-if="chatGroup" :hideMessageHeader="true" :disableSoundForMessages="true" :messageComposerConfiguration="messageComposerConfiguration" :messageListConfiguration="messageListConfiguration" :hideMessageComposer="false" :hideDetails="true" :group="chatGroup"></CometChatMessages>
116
116
  </div>
117
117
  </template>
118
118