@phonghq/go-chat 1.0.18 → 1.0.19

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.
@@ -102,7 +102,7 @@ const responsiveRender = computed(() => {
102
102
  });
103
103
  const list = computed(() => chatListRef.value?.listConversations ?? []);
104
104
  const unreadCount = computed(() => list.value?.reduce((total, cur) => total + (cur?.unread_count ?? 0), 0) ?? 0);
105
- const userRemote = computed(() => callingRef.value?.userRemoter ?? null);
105
+ const callStatus = computed(() => callingRef.value?.callStatus ?? null);
106
106
  const responsiveObserver = ref('tablet');
107
107
  const appChatRef = ref();
108
108
  const callingRef = ref(null);
@@ -144,22 +144,18 @@ const getResponsiveObserver = useDebounce(() => {
144
144
  }
145
145
  }
146
146
  }, 50);
147
- const getUserRemote = () => {
148
- return callingRef.value?.userRemoter ?? null;
149
- };
150
- const startCall = () => {
151
- return callingRef.value?.answer ?? undefined;
152
- };
153
- const endCall = () => {
154
- return callingRef.value?.endCall;
155
- };
156
147
  initPage({ props: props, response: props.response });
157
148
  let __VLS_exposed;
158
149
  defineExpose({
159
150
  unreadCount,
160
- getUserRemote,
161
- startCall,
162
- endCall,
151
+ callStatus,
152
+ getUserRemote: () => {
153
+ return callingRef.value?.userRemoter ?? null;
154
+ },
155
+ startCall: async () => {
156
+ await callingRef.value?.answer();
157
+ },
158
+ endCall: () => callingRef.value?.endCall()
163
159
  });
164
160
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
165
161
  const __VLS_defaults = {
@@ -11,7 +11,8 @@ export type GoChatProps = {
11
11
  export interface GoChatInstance {
12
12
  unreadCount: ComputedRef<number>;
13
13
  getUserRemote: () => (IResUser | null);
14
- startCall: any;
14
+ callStatus: ComputedRef<PLIVO_CALL_STATUS | null>;
15
+ startCall: (() => Promise<void>) | undefined;
15
16
  endCall: (() => void) | undefined;
16
17
  }
17
18
  export interface CallInstance {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phonghq/go-chat",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"