@phonghq/go-chat 1.0.57 → 1.0.59

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.
@@ -214,10 +214,14 @@ defineExpose({
214
214
  startCall: async () => {
215
215
  await callingRef.value?.answer();
216
216
  },
217
- endCall: () => callingRef.value?.endCall(),
217
+ endCall: () => {
218
+ console.log('9999999999999999999999999999999');
219
+ callingRef.value?.endCall();
220
+ },
218
221
  openSettings,
219
222
  initData: (data) => handleExposeInit(data),
220
223
  backToHome,
224
+ closeCallingModal: () => callingRef.value?.closeModal()
221
225
  });
222
226
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
223
227
  const __VLS_defaults = {
@@ -234,7 +238,7 @@ let __VLS_elements;
234
238
  let __VLS_components;
235
239
  let __VLS_directives;
236
240
  __VLS_asFunctionalElement(__VLS_elements.div, __VLS_elements.div)({
237
- ...{ class: "go-chat-main max-w-full" },
241
+ ...{ class: "go-chat-main max-w-full bg-white" },
238
242
  id: "appChatMain",
239
243
  ref: "appChatRef",
240
244
  });
@@ -287,10 +291,12 @@ else if (__VLS_ctx.currentPage == __VLS_ctx.PAGE.NOT_TENANT_PHONE) {
287
291
  // @ts-ignore
288
292
  const __VLS_16 = __VLS_asFunctionalComponent(NotTenantPhone, new NotTenantPhone({
289
293
  ...{ 'onTryAgain': {} },
294
+ ...{ class: "bg-white" },
290
295
  isLib: (props.isLib),
291
296
  }));
292
297
  const __VLS_17 = __VLS_16({
293
298
  ...{ 'onTryAgain': {} },
299
+ ...{ class: "bg-white" },
294
300
  isLib: (props.isLib),
295
301
  }, ...__VLS_functionalComponentArgsRest(__VLS_16));
296
302
  let __VLS_19;
@@ -862,10 +868,12 @@ else {
862
868
  }
863
869
  /** @type {__VLS_StyleScopedClasses['go-chat-main']} */ ;
864
870
  /** @type {__VLS_StyleScopedClasses['max-w-full']} */ ;
871
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
865
872
  /** @type {__VLS_StyleScopedClasses['m-auto']} */ ;
866
873
  /** @type {__VLS_StyleScopedClasses['flex-center']} */ ;
867
874
  /** @type {__VLS_StyleScopedClasses['sc-full']} */ ;
868
875
  /** @type {__VLS_StyleScopedClasses['mt-10']} */ ;
876
+ /** @type {__VLS_StyleScopedClasses['bg-white']} */ ;
869
877
  /** @type {__VLS_StyleScopedClasses['grow']} */ ;
870
878
  /** @type {__VLS_StyleScopedClasses['h-full']} */ ;
871
879
  /** @type {__VLS_StyleScopedClasses['overflow-hidden']} */ ;
@@ -31,11 +31,13 @@ const handlePlivoCallBack = (status, data) => {
31
31
  getUserOffer(data?.phone ?? '');
32
32
  }
33
33
  else if (status == PLIVO_CALL_STATUS.CONNECT_FAILED || status == PLIVO_CALL_STATUS.NO_ANSWER) {
34
+ console.log('5555555555555555555555555555555555555555555');
34
35
  endCall();
35
36
  }
36
37
  else if (status == PLIVO_CALL_STATUS.CALL_END) {
37
38
  errorMessage.value = data?.message ?? '';
38
39
  const closeModal = data?.reason == 'ORIGINATOR_CANCEL';
40
+ console.log('6666666666666666666666666666666666666666666666666');
39
41
  endCall({ closeModal });
40
42
  }
41
43
  else if (status == PLIVO_CALL_STATUS.CALL_START) {
@@ -98,6 +100,7 @@ onUnmounted(() => {
98
100
  clearInterval(timer);
99
101
  if (timeOut)
100
102
  clearTimeout(timeOut);
103
+ console.log('7777777777777777777777777777777777777777777777777');
101
104
  endCall();
102
105
  errorMessage.value = '';
103
106
  });
@@ -116,9 +119,9 @@ function startTimer() {
116
119
  }, 1000);
117
120
  }
118
121
  function endCall(option) {
122
+ console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
119
123
  if (option?.closeModal) {
120
- drawerVisible.value = false;
121
- drawerVisibleRef.value?.close();
124
+ closeModal();
122
125
  }
123
126
  audioRef.value?.pause();
124
127
  handleEmitEndCall(userRemoter.value, callType);
@@ -134,6 +137,10 @@ function endCall(option) {
134
137
  clearTimeout(timeOut);
135
138
  callType = '';
136
139
  }
140
+ const closeModal = () => {
141
+ drawerVisible.value = false;
142
+ drawerVisibleRef.value?.close();
143
+ };
137
144
  const handleEmitEndCall = useDebounce((data, type) => {
138
145
  emit('endCall', data, type);
139
146
  }, 500);
@@ -199,6 +206,7 @@ const startCall = async (data) => {
199
206
  callStatus.value = PLIVO_CALL_STATUS.CALLING;
200
207
  }
201
208
  catch (e) {
209
+ console.log('111111111111111111111111');
202
210
  endCall();
203
211
  console.log(e);
204
212
  errorMessage.value = e?.message || JSON.stringify(e);
@@ -210,6 +218,7 @@ const answer = async () => {
210
218
  await plivoCallAnswer();
211
219
  }
212
220
  catch (e) {
221
+ console.log('222222222222222222222222222222');
213
222
  endCall();
214
223
  callStatus.value = PLIVO_CALL_STATUS.CONNECT_FAILED;
215
224
  errorMessage.value = e?.message || JSON.stringify(e);
@@ -239,6 +248,7 @@ const getUserOffer = async (phone) => {
239
248
  };
240
249
  const handleTimeLimitError = () => {
241
250
  errorMessage.value = 'Call time limit reached. This call has ended.';
251
+ console.log('3333333333333333333333333333333333333333333333');
242
252
  endCall();
243
253
  };
244
254
  const exportRecordFile = async () => {
@@ -246,10 +256,11 @@ const exportRecordFile = async () => {
246
256
  };
247
257
  const handleAfterClose = () => {
248
258
  record_link.value = '';
259
+ errorMessage.value = '';
249
260
  uuidEnd = '';
250
261
  };
251
262
  let __VLS_exposed;
252
- defineExpose({ startCall, endCall, userRemoter, callStatus, answer, label });
263
+ defineExpose({ startCall, endCall, userRemoter, callStatus, answer, label, closeModal });
253
264
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
254
265
  const __VLS_defaults = {
255
266
  responsive: 'window'
@@ -64,6 +64,10 @@ export const useListConversations = (is_unknown, is_tenant) => {
64
64
  }
65
65
  };
66
66
  const mqttMessageHandler = (topic, data) => {
67
+ if (topic == TOPIC_HOME[3] + dataProfile.value?.id) {
68
+ getData({}, { reset: true });
69
+ return;
70
+ }
67
71
  if ((data.is_unknown ?? 0) == is_unknown || (!is_tenant && is_unknown == 0)) {
68
72
  getDataMqttDebounce();
69
73
  if (topic ===
@@ -10,6 +10,7 @@ export const TOPIC_HOME = [
10
10
  'chat/conversation/update/message-call/',
11
11
  'chat/conversation/update/sms-inbound/',
12
12
  'chat/conversation/read_message/',
13
+ 'chat/conversation/reload/sms-inbound/',
13
14
  ];
14
15
  // export CALL_STATE = {
15
16
  // Offer: 'offer',