@daeryun/dr_components 0.9.19 → 0.9.20
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/dist/components/Daeryuntalk/ChatInput.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatInput.tsx +1 -1
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +52 -51
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +52 -51
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +22 -21
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +22 -21
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +15 -14
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +15 -14
- package/dist/components/Daeryuntalk/_lib/index.js +0 -1
- package/dist/components/Daeryuntalk/_lib/index.ts +0 -1
- package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -0
- package/dist/components/Daeryuntalk/_lib/utils.js +5 -0
- package/dist/components/Daeryuntalk/_lib/utils.ts +6 -0
- package/dist/styles/globals.css +5 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHistory.d.ts +0 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHistory.js +0 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHistory.ts +0 -1
- package/dist/components/Daeryuntalk/_types/socket/message.d.ts +0 -0
- package/dist/components/Daeryuntalk/_types/socket/message.js +0 -1
- package/dist/components/Daeryuntalk/_types/socket/message.ts +0 -0
|
@@ -19,6 +19,7 @@ import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
|
19
19
|
import { router } from 'next/client';
|
|
20
20
|
import { useFullURL } from './useFullURL';
|
|
21
21
|
import { getErrorMessageMap } from '../../_enums/error';
|
|
22
|
+
import { consoleFn } from '../../_lib/utils';
|
|
22
23
|
interface props {
|
|
23
24
|
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
24
25
|
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
@@ -62,7 +63,7 @@ export const useChatHandler = ({
|
|
|
62
63
|
async (inquiryNumber?: string) => {
|
|
63
64
|
try {
|
|
64
65
|
setIsLoading(true);
|
|
65
|
-
|
|
66
|
+
consoleFn('[DaeryuntalkContext] 채팅 시작 요청');
|
|
66
67
|
|
|
67
68
|
// 기존 문의가 있는지 확인
|
|
68
69
|
const hasExistingInquiry =
|
|
@@ -75,10 +76,10 @@ export const useChatHandler = ({
|
|
|
75
76
|
currentChatInquiryNumber = inquiryNumber
|
|
76
77
|
? inquiryNumber
|
|
77
78
|
: inquiryMainData?.progress_inquiry_number || '';
|
|
78
|
-
|
|
79
|
+
consoleFn('[DaeryuntalkContext] 기존 문의 사용:', currentChatInquiryNumber);
|
|
79
80
|
} else {
|
|
80
81
|
// 새 문의 생성
|
|
81
|
-
|
|
82
|
+
consoleFn('[DaeryuntalkContext] 새 문의 생성 시작');
|
|
82
83
|
const createResponse = await generateChatInquiry(
|
|
83
84
|
inquiryMainData?.channel_number || '',
|
|
84
85
|
fullUrl,
|
|
@@ -98,7 +99,7 @@ export const useChatHandler = ({
|
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
// 문의 상세 조회
|
|
101
|
-
|
|
102
|
+
consoleFn('[DaeryuntalkContext] 문의 상세 조회 시작:', currentChatInquiryNumber);
|
|
102
103
|
const detailResponse = await getChatInquiryDetailNew(currentChatInquiryNumber);
|
|
103
104
|
if (
|
|
104
105
|
!(
|
|
@@ -110,21 +111,21 @@ export const useChatHandler = ({
|
|
|
110
111
|
toast.error(getErrorMessageMap(detailResponse));
|
|
111
112
|
return detailResponse;
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
+
consoleFn('[DaeryuntalkContext] 문의 상세 조회 완료:', detailResponse);
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
consoleFn('[DaeryuntalkContext] 문의 채팅 리스트 조회 시작:', currentChatInquiryNumber);
|
|
116
117
|
const chatList = await getChatInquiryMessageList(currentChatInquiryNumber);
|
|
117
118
|
if (!(chatList.result_info.result_cd === 'OK' || chatList.result_info.result_type_cd === 'OK')) {
|
|
118
119
|
resetData();
|
|
119
120
|
toast.error(getErrorMessageMap(chatList));
|
|
120
121
|
return chatList;
|
|
121
122
|
}
|
|
122
|
-
|
|
123
|
+
consoleFn('[DaeryuntalkContext] 문의 채팅 리스트 조회 완료:', chatList);
|
|
123
124
|
|
|
124
125
|
// 문의 정보 저장
|
|
125
126
|
setChatInquiryNumber(currentChatInquiryNumber);
|
|
126
127
|
|
|
127
|
-
|
|
128
|
+
consoleFn('detailResponse.data.message_list', chatList?.data?.message_list);
|
|
128
129
|
|
|
129
130
|
// 메시지 처리
|
|
130
131
|
// 메세지 리스트 후처리
|
|
@@ -133,7 +134,7 @@ export const useChatHandler = ({
|
|
|
133
134
|
.sort((a, b) => a.timestamp - b.timestamp) // timestamp 오름차순 (최신이 마지막에)
|
|
134
135
|
.map(convertApiMessageToUiMessage);
|
|
135
136
|
setMessages(uiMessages);
|
|
136
|
-
|
|
137
|
+
consoleFn('[DaeryuntalkContext] 메시지 설정 완료:', uiMessages.length);
|
|
137
138
|
}
|
|
138
139
|
if (chatList.data?.next_page_yn !== null) {
|
|
139
140
|
setIsNextPage(chatList.data.next_page_yn);
|
|
@@ -191,17 +192,17 @@ export const useChatHandler = ({
|
|
|
191
192
|
return detailResponse;
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
consoleFn('[DaeryuntalkContext] 문의 상세 조회 완료:', detailResponse);
|
|
195
196
|
|
|
196
197
|
const chatList = await getChatInquiryMessageList(chatInquiryNumber);
|
|
197
|
-
|
|
198
|
+
consoleFn('[DaeryuntalkContext] 문의 채팅 리스트 조회 완료:', chatList);
|
|
198
199
|
if (!(chatList.result_info.result_cd === 'OK' || chatList.result_info.result_type_cd === 'OK')) {
|
|
199
200
|
resetData();
|
|
200
201
|
toast.error(getErrorMessageMap(chatList));
|
|
201
202
|
return chatList;
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
consoleFn('detailResponse.data.message_list', chatList?.data?.message_list);
|
|
205
206
|
|
|
206
207
|
// 메시지 처리
|
|
207
208
|
// 문의 정보 저장
|
|
@@ -227,7 +228,7 @@ export const useChatHandler = ({
|
|
|
227
228
|
// const uiMessages = chatList.data.message_list.map(convertApiMessageToUiMessage);
|
|
228
229
|
setMessages(uiMessages);
|
|
229
230
|
|
|
230
|
-
|
|
231
|
+
consoleFn('[DaeryuntalkContext] 메시지 설정 완료:', uiMessages.length);
|
|
231
232
|
}
|
|
232
233
|
if (chatList.data?.next_page_yn !== null) {
|
|
233
234
|
setIsNextPage(chatList.data.next_page_yn);
|
|
@@ -268,7 +269,7 @@ export const useChatHandler = ({
|
|
|
268
269
|
async (htmlContent: string, jsonData: any, retry?: boolean) => {
|
|
269
270
|
try {
|
|
270
271
|
setIsLoading?.(true);
|
|
271
|
-
|
|
272
|
+
consoleFn('chatInquiryNumber', chatInquiryNumber);
|
|
272
273
|
const response = await sendChatMessage(chatInquiryNumber as string, htmlContent, jsonData);
|
|
273
274
|
if (!(response.result_info.result_cd === 'OK' || response.result_info.result_type_cd === 'OK')) {
|
|
274
275
|
toast.error(getErrorMessageMap(response));
|
|
@@ -293,7 +294,7 @@ export const useChatHandler = ({
|
|
|
293
294
|
return;
|
|
294
295
|
}
|
|
295
296
|
setIsLoading?.(true);
|
|
296
|
-
|
|
297
|
+
consoleFn('chatInquiryNumber', chatInquiryNumber);
|
|
297
298
|
const createResponse = await generateChatInquiry(
|
|
298
299
|
inquiryMainData?.channel_number || '',
|
|
299
300
|
fullUrl,
|
|
@@ -309,12 +310,12 @@ export const useChatHandler = ({
|
|
|
309
310
|
return createResponse;
|
|
310
311
|
}
|
|
311
312
|
|
|
312
|
-
|
|
313
|
+
consoleFn('[DaeryuntalkContext] 새 문의 생성 완료:', createResponse);
|
|
313
314
|
const currentChatInquiryNumber = createResponse.data.chat_inquiry_number;
|
|
314
315
|
// 문의 상세 조회
|
|
315
|
-
|
|
316
|
+
consoleFn('[DaeryuntalkContext] 문의 상세 조회 시작:', currentChatInquiryNumber);
|
|
316
317
|
const detailResponse = await getChatInquiryDetailNew(currentChatInquiryNumber);
|
|
317
|
-
|
|
318
|
+
consoleFn('[DaeryuntalkContext] 문의 상세 조회 완료:', detailResponse);
|
|
318
319
|
if (
|
|
319
320
|
!(
|
|
320
321
|
detailResponse.result_info.result_cd === 'OK' ||
|
|
@@ -327,9 +328,9 @@ export const useChatHandler = ({
|
|
|
327
328
|
}
|
|
328
329
|
|
|
329
330
|
// 메세지 리스트
|
|
330
|
-
|
|
331
|
+
consoleFn('[DaeryuntalkContext] 문의 채팅 리스트 조회 시작:', currentChatInquiryNumber);
|
|
331
332
|
const chatList = await getChatInquiryMessageList(currentChatInquiryNumber);
|
|
332
|
-
|
|
333
|
+
consoleFn('[DaeryuntalkContext] 문의 채팅 리스트 조회 완료:', chatList);
|
|
333
334
|
|
|
334
335
|
if (!(chatList.result_info.result_cd === 'OK' || chatList.result_info.result_type_cd === 'OK')) {
|
|
335
336
|
resetData();
|
|
@@ -345,7 +346,7 @@ export const useChatHandler = ({
|
|
|
345
346
|
.sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
|
|
346
347
|
.map(convertApiMessageToUiMessage);
|
|
347
348
|
setMessages(uiMessages);
|
|
348
|
-
|
|
349
|
+
consoleFn('[DaeryuntalkContext] 메시지 설정 완료:', uiMessages.length);
|
|
349
350
|
}
|
|
350
351
|
if (chatList.data?.next_page_yn !== null) {
|
|
351
352
|
setIsNextPage(chatList.data.next_page_yn);
|
|
@@ -14,6 +14,7 @@ import { MessageSendSocketType, MessageSocketType } from '../../_enums/socket_ty
|
|
|
14
14
|
import { InquiryStatusEnum } from '../../_enums/ask-status';
|
|
15
15
|
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
16
16
|
import { getErrorMessageMap } from '../../_enums/error';
|
|
17
|
+
import { consoleFn } from '../../_lib/utils';
|
|
17
18
|
export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping, onClose, centerCode, setPreviewState, setIsUserExpried }) => {
|
|
18
19
|
const typingTimeoutRef = useRef(null);
|
|
19
20
|
const toast = useDaeryunTalkToast();
|
|
@@ -50,7 +51,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
50
51
|
type: MessageSendSocketType.HEARTBEAT,
|
|
51
52
|
payload: {}
|
|
52
53
|
}));
|
|
53
|
-
|
|
54
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HEARTBEAT} 전송`);
|
|
54
55
|
}
|
|
55
56
|
}, []);
|
|
56
57
|
const sendInquiryWatching = useCallback((chatInquiryNumber) => {
|
|
@@ -60,7 +61,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
60
61
|
type: MessageSendSocketType.INQUIRY_WATCHING,
|
|
61
62
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
62
63
|
}));
|
|
63
|
-
|
|
64
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_WATCHING} 전송`);
|
|
64
65
|
}
|
|
65
66
|
}, []);
|
|
66
67
|
/**
|
|
@@ -82,7 +83,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
82
83
|
type: MessageSendSocketType.INQUIRY_JOINED,
|
|
83
84
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
84
85
|
}));
|
|
85
|
-
|
|
86
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_JOINED} 전송`);
|
|
86
87
|
}
|
|
87
88
|
}, []);
|
|
88
89
|
/**
|
|
@@ -104,7 +105,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
104
105
|
type: MessageSendSocketType.INQUIRY_LEFT,
|
|
105
106
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
106
107
|
}));
|
|
107
|
-
|
|
108
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_LEFT} 전송`);
|
|
108
109
|
}
|
|
109
110
|
}, []);
|
|
110
111
|
/**
|
|
@@ -130,7 +131,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
130
131
|
type: MessageSendSocketType.HISTORY_ENTERED,
|
|
131
132
|
payload: { chat_inquiry_numbers: chatInquiryNumbers }
|
|
132
133
|
}));
|
|
133
|
-
|
|
134
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HISTORY_ENTERED} 전송`);
|
|
134
135
|
}
|
|
135
136
|
}, []);
|
|
136
137
|
// -> 사용 X
|
|
@@ -141,30 +142,30 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
141
142
|
type: MessageSendSocketType.HISTORY_EXITED,
|
|
142
143
|
payload: { chat_inquiry_numbers: chatInquiryNumbers }
|
|
143
144
|
}));
|
|
144
|
-
|
|
145
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HISTORY_EXITED} 전송`);
|
|
145
146
|
}
|
|
146
147
|
}, []);
|
|
147
148
|
// Daeryuntalk API 초기화 메소드
|
|
148
149
|
const initializeDaeryuntalk = useCallback((hashValue, isOpen, centerCode, version) => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
150
|
var _a, _b, _c, _d, _e;
|
|
150
151
|
if (userExpiredRef.current) {
|
|
151
|
-
|
|
152
|
+
consoleFn('유저 만료 상태로 초기화 X');
|
|
152
153
|
return;
|
|
153
154
|
}
|
|
154
|
-
|
|
155
|
+
consoleFn('[DaeryuntalkContext] 초기화 메소드 호출됨', version ? `버전: ${version}` : '기본 버전 사용');
|
|
155
156
|
try {
|
|
156
157
|
setPreviewState('home');
|
|
157
158
|
setIsLoading(true);
|
|
158
|
-
|
|
159
|
+
consoleFn('[DaeryuntalkContext] 로딩 상태 설정: true');
|
|
159
160
|
const { inquiryData, socket, hashAuth, errorCode } = yield apiInitializeDaeryuntalk(hashValue || '', isOpen, setIsConnected, isMobile, centerCode, userExpiredRef, socket => {
|
|
160
|
-
|
|
161
|
+
consoleFn('[DaeryuntalkContext] 웹소켓 연결 콜백 - 연결 성공');
|
|
161
162
|
setIsConnected(true);
|
|
162
163
|
}, event => {
|
|
163
164
|
var _a;
|
|
164
|
-
|
|
165
|
+
consoleFn('[DaeryuntalkContext] 웹소켓 메시지 수신됨');
|
|
165
166
|
try {
|
|
166
167
|
const data = typeof event === 'string' ? JSON.parse(event) : event;
|
|
167
|
-
|
|
168
|
+
consoleFn('socket data', data);
|
|
168
169
|
// 메시지 생성
|
|
169
170
|
if (data.type === MessageSocketType.MESSAGE_CREATED && ((_a = data.payload) === null || _a === void 0 ? void 0 : _a.message)) {
|
|
170
171
|
const newMessage = convertApiMessageToUiMessage(data.payload.message);
|
|
@@ -256,7 +257,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
256
257
|
}
|
|
257
258
|
if (hashValue) {
|
|
258
259
|
if (((_b = hashAuth === null || hashAuth === void 0 ? void 0 : hashAuth.result_info) === null || _b === void 0 ? void 0 : _b.result_cd) === 'OK' || ((_c = hashAuth === null || hashAuth === void 0 ? void 0 : hashAuth.result_info) === null || _c === void 0 ? void 0 : _c.result_type_cd) === 'OK') {
|
|
259
|
-
|
|
260
|
+
consoleFn('해쉬 인증 완료');
|
|
260
261
|
}
|
|
261
262
|
else {
|
|
262
263
|
toast.error('링크가 만료되었거나 존재하지 않습니다.');
|
|
@@ -279,7 +280,7 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
279
280
|
console.error('[DaeryuntalkContext] 초기화 오류:', error);
|
|
280
281
|
}
|
|
281
282
|
finally {
|
|
282
|
-
|
|
283
|
+
consoleFn('[DaeryuntalkContext] 로딩 상태 설정: false');
|
|
283
284
|
setIsLoading(false);
|
|
284
285
|
}
|
|
285
286
|
}), [historyList]);
|
|
@@ -17,6 +17,7 @@ import { InquiryStatusEnum } from '../../_enums/ask-status';
|
|
|
17
17
|
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
18
18
|
import { getErrorMessageMap } from '../../_enums/error';
|
|
19
19
|
import { ViewState } from '../../ChatHomeView';
|
|
20
|
+
import { consoleFn } from '../../_lib/utils';
|
|
20
21
|
|
|
21
22
|
interface props {
|
|
22
23
|
setIsConnected: Dispatch<SetStateAction<boolean | null>>;
|
|
@@ -100,7 +101,7 @@ export const useSocketEventHandler = ({
|
|
|
100
101
|
payload: {}
|
|
101
102
|
})
|
|
102
103
|
);
|
|
103
|
-
|
|
104
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HEARTBEAT} 전송`);
|
|
104
105
|
}
|
|
105
106
|
}, []);
|
|
106
107
|
|
|
@@ -113,7 +114,7 @@ export const useSocketEventHandler = ({
|
|
|
113
114
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
114
115
|
})
|
|
115
116
|
);
|
|
116
|
-
|
|
117
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_WATCHING} 전송`);
|
|
117
118
|
}
|
|
118
119
|
}, []);
|
|
119
120
|
|
|
@@ -138,7 +139,7 @@ export const useSocketEventHandler = ({
|
|
|
138
139
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
139
140
|
})
|
|
140
141
|
);
|
|
141
|
-
|
|
142
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_JOINED} 전송`);
|
|
142
143
|
}
|
|
143
144
|
}, []);
|
|
144
145
|
|
|
@@ -163,7 +164,7 @@ export const useSocketEventHandler = ({
|
|
|
163
164
|
payload: { chat_inquiry_number: chatInquiryNumber }
|
|
164
165
|
})
|
|
165
166
|
);
|
|
166
|
-
|
|
167
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.INQUIRY_LEFT} 전송`);
|
|
167
168
|
}
|
|
168
169
|
}, []);
|
|
169
170
|
|
|
@@ -192,7 +193,7 @@ export const useSocketEventHandler = ({
|
|
|
192
193
|
payload: { chat_inquiry_numbers: chatInquiryNumbers }
|
|
193
194
|
})
|
|
194
195
|
);
|
|
195
|
-
|
|
196
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HISTORY_ENTERED} 전송`);
|
|
196
197
|
}
|
|
197
198
|
}, []);
|
|
198
199
|
// -> 사용 X
|
|
@@ -205,7 +206,7 @@ export const useSocketEventHandler = ({
|
|
|
205
206
|
payload: { chat_inquiry_numbers: chatInquiryNumbers }
|
|
206
207
|
})
|
|
207
208
|
);
|
|
208
|
-
|
|
209
|
+
consoleFn(`[WebSocket] ${MessageSendSocketType.HISTORY_EXITED} 전송`);
|
|
209
210
|
}
|
|
210
211
|
}, []);
|
|
211
212
|
|
|
@@ -213,14 +214,14 @@ export const useSocketEventHandler = ({
|
|
|
213
214
|
const initializeDaeryuntalk = useCallback(
|
|
214
215
|
async (hashValue: string | null, isOpen: boolean, centerCode: string, version?: string) => {
|
|
215
216
|
if (userExpiredRef.current) {
|
|
216
|
-
|
|
217
|
+
consoleFn('유저 만료 상태로 초기화 X');
|
|
217
218
|
return;
|
|
218
219
|
}
|
|
219
|
-
|
|
220
|
+
consoleFn('[DaeryuntalkContext] 초기화 메소드 호출됨', version ? `버전: ${version}` : '기본 버전 사용');
|
|
220
221
|
try {
|
|
221
222
|
setPreviewState('home');
|
|
222
223
|
setIsLoading(true);
|
|
223
|
-
|
|
224
|
+
consoleFn('[DaeryuntalkContext] 로딩 상태 설정: true');
|
|
224
225
|
|
|
225
226
|
const { inquiryData, socket, hashAuth, errorCode } = await apiInitializeDaeryuntalk(
|
|
226
227
|
hashValue || '',
|
|
@@ -230,14 +231,14 @@ export const useSocketEventHandler = ({
|
|
|
230
231
|
centerCode,
|
|
231
232
|
userExpiredRef,
|
|
232
233
|
socket => {
|
|
233
|
-
|
|
234
|
+
consoleFn('[DaeryuntalkContext] 웹소켓 연결 콜백 - 연결 성공');
|
|
234
235
|
setIsConnected(true);
|
|
235
236
|
},
|
|
236
237
|
event => {
|
|
237
|
-
|
|
238
|
+
consoleFn('[DaeryuntalkContext] 웹소켓 메시지 수신됨');
|
|
238
239
|
try {
|
|
239
240
|
const data = typeof event === 'string' ? JSON.parse(event) : event;
|
|
240
|
-
|
|
241
|
+
consoleFn('socket data', data);
|
|
241
242
|
// 메시지 생성
|
|
242
243
|
if (data.type === MessageSocketType.MESSAGE_CREATED && data.payload?.message) {
|
|
243
244
|
const newMessage = convertApiMessageToUiMessage(data.payload.message);
|
|
@@ -357,7 +358,7 @@ export const useSocketEventHandler = ({
|
|
|
357
358
|
|
|
358
359
|
if (hashValue) {
|
|
359
360
|
if (hashAuth?.result_info?.result_cd === 'OK' || hashAuth?.result_info?.result_type_cd === 'OK') {
|
|
360
|
-
|
|
361
|
+
consoleFn('해쉬 인증 완료');
|
|
361
362
|
} else {
|
|
362
363
|
toast.error('링크가 만료되었거나 존재하지 않습니다.');
|
|
363
364
|
setTimeout(() => {
|
|
@@ -381,7 +382,7 @@ export const useSocketEventHandler = ({
|
|
|
381
382
|
} catch (error) {
|
|
382
383
|
console.error('[DaeryuntalkContext] 초기화 오류:', error);
|
|
383
384
|
} finally {
|
|
384
|
-
|
|
385
|
+
consoleFn('[DaeryuntalkContext] 로딩 상태 설정: false');
|
|
385
386
|
setIsLoading(false);
|
|
386
387
|
}
|
|
387
388
|
},
|
|
@@ -54,7 +54,6 @@ export const convertApiMessageToUiMessage = (apiMessage) => {
|
|
|
54
54
|
// API불러왔을 때용도
|
|
55
55
|
export const convertApiMessageObjectToUiMessageObject = (apiObject) => {
|
|
56
56
|
var _a, _b;
|
|
57
|
-
console.log('apiObject', apiObject);
|
|
58
57
|
const result = {
|
|
59
58
|
exposeObjectListYn: apiObject.object_expose_info.expose_object_list_yn,
|
|
60
59
|
messageNumber: apiObject.object_expose_info.message_number,
|
|
@@ -89,7 +89,6 @@ export const convertApiMessageToUiMessage = (apiMessage: ApiChatMessage): Messag
|
|
|
89
89
|
|
|
90
90
|
// API불러왔을 때용도
|
|
91
91
|
export const convertApiMessageObjectToUiMessageObject = (apiObject: ChatInquiryDetailDataResponse): MessageObject => {
|
|
92
|
-
console.log('apiObject', apiObject);
|
|
93
92
|
const result: MessageObject = {
|
|
94
93
|
exposeObjectListYn: apiObject.object_expose_info.expose_object_list_yn,
|
|
95
94
|
messageNumber: apiObject.object_expose_info.message_number,
|
|
@@ -14,3 +14,4 @@ export declare const formatSecondsToMMSS: (seconds: number) => string;
|
|
|
14
14
|
export declare const formatTimestamp: (timestamp: string) => string;
|
|
15
15
|
export declare const stripHtmlTags: (input: string) => string;
|
|
16
16
|
export declare const decodeDoubleEscapedHtml: (escaped: string) => string;
|
|
17
|
+
export declare const consoleFn: (...args: any[]) => void;
|
|
@@ -111,3 +111,9 @@ export const decodeDoubleEscapedHtml = (escaped: string) => {
|
|
|
111
111
|
textArea.innerHTML = onceDecoded;
|
|
112
112
|
return textArea.value;
|
|
113
113
|
};
|
|
114
|
+
|
|
115
|
+
export const consoleFn = (...args: any[]) => {
|
|
116
|
+
if (process.env.NODE_ENV === 'development') {
|
|
117
|
+
console.log(...args);
|
|
118
|
+
}
|
|
119
|
+
};
|
package/dist/styles/globals.css
CHANGED
|
@@ -4817,6 +4817,11 @@ video {
|
|
|
4817
4817
|
border-color: rgb(237 237 237 / var(--tw-border-opacity, 1));
|
|
4818
4818
|
}
|
|
4819
4819
|
|
|
4820
|
+
.border-drTalkGrayscale5 {
|
|
4821
|
+
--tw-border-opacity: 1;
|
|
4822
|
+
border-color: rgb(247 247 247 / var(--tw-border-opacity, 1));
|
|
4823
|
+
}
|
|
4824
|
+
|
|
4820
4825
|
.border-gray-100 {
|
|
4821
4826
|
--tw-border-opacity: 1;
|
|
4822
4827
|
border-color: rgb(243 244 246 / var(--tw-border-opacity, 1));
|