@phonghq/go-chat 1.0.70 → 1.0.71

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.
@@ -16,7 +16,6 @@ declare const _default: import("vue").DefineComponent<GoChatProps, GoChatInstanc
16
16
  onEndCall?: (() => any) | undefined;
17
17
  "onError:noPhoneTenant"?: (() => any) | undefined;
18
18
  }>, {
19
- isLib: boolean;
20
19
  response: PAGE_RESPONSIVE;
21
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
21
  export default _default;
@@ -92,7 +92,6 @@ const routerMobileConfig = computed(() => [
92
92
  ]);
93
93
  const props = withDefaults(defineProps(), {
94
94
  response: 'tablet',
95
- isLib: true
96
95
  });
97
96
  const emit = defineEmits();
98
97
  let initTimer = null;
@@ -226,7 +225,6 @@ defineExpose({
226
225
  debugger; /* PartiallyEnd: #3632/scriptSetup.vue */
227
226
  const __VLS_defaults = {
228
227
  response: 'tablet',
229
- isLib: true
230
228
  };
231
229
  const __VLS_ctx = {
232
230
  ...{},
@@ -63,6 +63,7 @@ const STATUS_LABEL = computed(() => {
63
63
  [PLIVO_CALL_STATUS.CHECK_USER_OFFER]: ''
64
64
  };
65
65
  });
66
+ const REFRESH_TOKEN_TIME = 15 * 60 * 1000;
66
67
  const label = computed(() => STATUS_LABEL.value[callStatus.value] ?? '');
67
68
  const callStatus = ref(PLIVO_CALL_STATUS.CONNECTING);
68
69
  const duration = ref('00:00');
@@ -86,7 +87,7 @@ onMounted(async () => {
86
87
  if (dataProfile.value?.phone) {
87
88
  const token = await getPlivoAccessToken();
88
89
  await plivoLogin({ token });
89
- setTimeout(refreshToken, 15 * 60 * 1000);
90
+ setTimeout(refreshToken, REFRESH_TOKEN_TIME);
90
91
  }
91
92
  }
92
93
  catch {
@@ -94,8 +95,14 @@ onMounted(async () => {
94
95
  }
95
96
  });
96
97
  onBeforeUnmount(() => {
98
+ if (timer)
99
+ clearInterval(timer);
100
+ if (timeOut)
101
+ clearTimeout(timeOut);
102
+ endCall();
97
103
  console.log('aaaaaaaaaaaaaaaaaaaaaaaa');
98
104
  plivoRemoveCallBack();
105
+ errorMessage.value = '';
99
106
  });
100
107
  onUnmounted(() => {
101
108
  if (timer)
@@ -154,7 +161,7 @@ const refreshToken = async () => {
154
161
  }
155
162
  const token = await getPlivoAccessToken();
156
163
  await plivoLogin({ token, isRefresh: true });
157
- setTimeout(() => refreshToken(), 15 * 60 * 1000);
164
+ setTimeout(() => refreshToken(), REFRESH_TOKEN_TIME);
158
165
  refreshTokenCount = 0;
159
166
  }
160
167
  catch (e) {
@@ -249,7 +256,7 @@ const getUserOffer = async (phone) => {
249
256
  const handleTimeLimitError = () => {
250
257
  console.log(isPlivoOn.value, 'isPlivoOn.value isPlivoOn.value');
251
258
  console.log(isPlivoOn2, 'isPlivoOn2');
252
- if (!isPlivoOn2)
259
+ if (!isPlivoOn.value)
253
260
  return;
254
261
  errorMessage.value = 'Call time limit reached. This call has ended.';
255
262
  endCall();