@bcc-code/vue-bcc-chat-ui 3.40.0 → 3.40.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.
package/package.json
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PropType,
|
|
4
4
|
Ref,
|
|
5
|
-
onBeforeMount,
|
|
6
5
|
onBeforeUnmount,
|
|
7
6
|
onMounted,
|
|
8
7
|
onUnmounted,
|
|
@@ -68,7 +67,11 @@ const onMessageSend = CometChatMessageEvents.ccMessageSent.subscribe(({ message,
|
|
|
68
67
|
|
|
69
68
|
watch([loggedIn, () => props.chatUid, chat.initialized, () => props.groupMessageGetter], async ([_loggedIn, _chatUid, _initialized, _groupMessageGetter]) => {
|
|
70
69
|
if (_loggedIn && _chatUid && _initialized) {
|
|
71
|
-
|
|
70
|
+
const [_, group] = await Promise.all([
|
|
71
|
+
connect(componentId.value),
|
|
72
|
+
chat.getGroup(props.chatUid)
|
|
73
|
+
])
|
|
74
|
+
chatGroup.value = group ?? undefined;
|
|
72
75
|
|
|
73
76
|
if (_groupMessageGetter && !chatGroup.value?.getHasJoined()) {
|
|
74
77
|
chat.updateGetGroupMessages(_groupMessageGetter)
|
|
@@ -91,9 +94,6 @@ watch([loggedIn, () => props.chatUid, chat.initialized, () => props.groupMessage
|
|
|
91
94
|
}
|
|
92
95
|
}, { immediate: true });
|
|
93
96
|
|
|
94
|
-
onBeforeMount(() => {
|
|
95
|
-
connect(componentId.value);
|
|
96
|
-
});
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
onMounted(() => {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { useAttrs } from 'vue';
|
|
4
|
-
import { CometChatMessageList } from "@cometchat/chat-uikit-vue";
|
|
5
|
-
import chat from "../chat";
|
|
6
|
-
|
|
7
|
-
// The purpose of this file is to force the component to be "reloaded" when switching between online and offline vue. I.e. so that messages will be loaded again
|
|
8
|
-
// AND the user scrolled to the bottom when coming online. The default implementation has issues with scrolling the user to the bottom in some cases.
|
|
9
|
-
|
|
10
|
-
// The reason for doing this for the CometChatMessageList specifically(instead of the whole chat window) is to avoid losing messages that the user may
|
|
11
|
-
// have started writing in the chat box before going offline.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const attrs = useAttrs();
|
|
15
|
-
|
|
16
|
-
// Work-around to avoid id being set to the wrong ID when switching between online and offline message view
|
|
17
|
-
// For some reason switching between the first and second message list below resulted in messageRequestBuilder.id to be set to the previous message
|
|
18
|
-
// after every online/offline switch resulting in on message being removed from the conversation each time.
|
|
19
|
-
const modifiedAttrs = computed(() => {
|
|
20
|
-
const newAttrs = { ...attrs };
|
|
21
|
-
newAttrs.connected = chat.connected.value;
|
|
22
|
-
newAttrs.messagesRequestBuilder.id = 0;
|
|
23
|
-
return newAttrs;
|
|
24
|
-
});
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<CometChatMessageList v-if="chat.connected.value" v-bind="modifiedAttrs" />
|
|
29
|
-
<CometChatMessageList v-else v-bind="modifiedAttrs" />
|
|
30
|
-
</template>
|