@phonghq/go-chat 1.0.48 → 1.0.50

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.
@@ -1,7 +1,6 @@
1
1
  /// <reference types="C:/phonghq/go-chat-v2/node_modules/.vue-global-types/vue_3.5_0.d.ts" />
2
2
  import { ref } from 'vue';
3
3
  import DrawerBaseCustom from '../../../components/common/drawer/DrawerBaseCustom.vue';
4
- import { responsiveObserver } from '../../../composable/useListentEvent';
5
4
  import PhoneNumpad from '../../../views/home/phone-numpad/PhoneNumpad.vue';
6
5
  const emit = defineEmits();
7
6
  const props = withDefaults(defineProps(), {});
@@ -28,9 +27,9 @@ const __VLS_ctx = {
28
27
  let __VLS_elements;
29
28
  let __VLS_components;
30
29
  let __VLS_directives;
31
- if (__VLS_ctx.responsiveObserver == 'window') {
30
+ if (__VLS_ctx.responsive == 'window') {
32
31
  // @ts-ignore
33
- [responsiveObserver,];
32
+ [responsive,];
34
33
  /** @type {[typeof PhoneNumpad, ]} */ ;
35
34
  // @ts-ignore
36
35
  const __VLS_0 = __VLS_asFunctionalComponent(PhoneNumpad, new PhoneNumpad({
@@ -52,12 +51,12 @@ if (__VLS_ctx.responsiveObserver == 'window') {
52
51
  const __VLS_5 = ({ call: {} },
53
52
  { onCall: (__VLS_ctx.handleCall) });
54
53
  // @ts-ignore
55
- [hideNumpad, responsive, handleCall,];
54
+ [responsive, hideNumpad, handleCall,];
56
55
  var __VLS_2;
57
56
  }
58
- if (__VLS_ctx.responsiveObserver != 'window') {
57
+ if (__VLS_ctx.responsive != 'window') {
59
58
  // @ts-ignore
60
- [responsiveObserver,];
59
+ [responsive,];
61
60
  /** @type {[typeof DrawerBaseCustom, typeof DrawerBaseCustom, ]} */ ;
62
61
  // @ts-ignore
63
62
  const __VLS_7 = __VLS_asFunctionalComponent(DrawerBaseCustom, new DrawerBaseCustom({
@@ -102,11 +101,11 @@ if (__VLS_ctx.responsiveObserver != 'window') {
102
101
  { onCall: (__VLS_ctx.handleCall) });
103
102
  const __VLS_20 = ({ back: {} },
104
103
  { onBack: (...[$event]) => {
105
- if (!(__VLS_ctx.responsiveObserver != 'window'))
104
+ if (!(__VLS_ctx.responsive != 'window'))
106
105
  return;
107
106
  __VLS_ctx.drawerVisibleRef?.close();
108
107
  // @ts-ignore
109
- [hideNumpad, responsive, handleCall, drawerVisibleRef,];
108
+ [responsive, hideNumpad, handleCall, drawerVisibleRef,];
110
109
  } });
111
110
  /** @type {typeof __VLS_ctx.phoneNumpadRef} */ ;
112
111
  var __VLS_21 = {};
@@ -111,9 +111,7 @@ function endCall(option) {
111
111
  drawerVisible.value = false;
112
112
  drawerVisibleRef.value?.close();
113
113
  }
114
- else {
115
- handleEmitEndCall(userRemoter.value, callType);
116
- }
114
+ handleEmitEndCall(userRemoter.value, callType);
117
115
  plivoEndCall(callStatus.value);
118
116
  callStatus.value = PLIVO_CALL_STATUS.CALL_END;
119
117
  clearInterval(timer);
@@ -131,7 +129,6 @@ const handleEmitEndCall = useDebounce((data, type) => {
131
129
  }, 500);
132
130
  const refreshToken = async () => {
133
131
  try {
134
- console.log('refreshToken: ');
135
132
  if (refreshTokenTimeOut) {
136
133
  clearTimeout(refreshTokenTimeOut);
137
134
  refreshTokenTimeOut = null;
@@ -144,7 +141,6 @@ const refreshToken = async () => {
144
141
  catch (e) {
145
142
  console.log(e);
146
143
  refreshTokenCount = refreshTokenCount + 1;
147
- console.log(refreshTokenCount);
148
144
  if (refreshTokenCount < 3) {
149
145
  setTimeout(() => refreshToken(), 60 * 1000);
150
146
  }
@@ -198,6 +194,7 @@ const getUserOffer = async (phone) => {
198
194
  let res = null;
199
195
  try {
200
196
  userRemoter.value = { phone, username: '' };
197
+ emit('userCalling', userRemoter.value);
201
198
  let data = {
202
199
  phone: formatPhone10number(phone, '1'),
203
200
  client_id: dataProfile.value?.tenant_id ?? ''
@@ -46,5 +46,7 @@ export type IUploadFile = {
46
46
  path: string;
47
47
  url: string;
48
48
  delete_url: string;
49
+ error: boolean;
50
+ errors: string;
49
51
  };
50
52
  export type MessageStateType = typeof MessageState[keyof typeof MessageState];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phonghq/go-chat",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist"