@daeryun/dr_components 0.8.85 → 0.8.86
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatConversation.jsx +55 -3
- package/dist/components/Daeryuntalk/ChatConversation.tsx +61 -2
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.jsx +28 -0
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.tsx +38 -0
- package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +1 -0
- package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +8 -3
- package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +10 -3
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +7 -6
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +7 -6
- package/dist/components/Daeryuntalk/_enums/socket_type.d.ts +3 -1
- package/dist/components/Daeryuntalk/_enums/socket_type.js +2 -0
- package/dist/components/Daeryuntalk/_enums/socket_type.ts +4 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +18 -2
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +26 -1
- package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.js +5 -12
- package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.ts +5 -12
- package/dist/styles/globals.css +19 -10
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
3
|
+
import ChatWrapper from './ChatWrapper';
|
|
4
|
+
const TypingComp = () => {
|
|
5
|
+
return (<div className="flex flex-col">
|
|
6
|
+
<div className="flex items-center gap-[10px]">
|
|
7
|
+
<div className="flex-shrink-0 rounded-full">
|
|
8
|
+
<div className="relative h-full w-full">
|
|
9
|
+
<DaeryunLogoIcon width={24} height={24}/>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<div className="flex items-end pl-[34px]">
|
|
16
|
+
<ChatWrapper isOperator={true} className="!border-[0px] !px-[0px]">
|
|
17
|
+
<div className="flex h-[36px] items-center ">
|
|
18
|
+
<div className="flex animate-pulse space-x-2 rounded-full ">
|
|
19
|
+
<div className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale2 "></div>
|
|
20
|
+
<div className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale3" style={{ animationDelay: '0.2s' }}></div>
|
|
21
|
+
<div className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale3" style={{ animationDelay: '0.4s' }}></div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</ChatWrapper>
|
|
25
|
+
</div>
|
|
26
|
+
</div>);
|
|
27
|
+
};
|
|
28
|
+
export default TypingComp;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
3
|
+
import ChatWrapper from './ChatWrapper';
|
|
4
|
+
|
|
5
|
+
const TypingComp = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex flex-col">
|
|
8
|
+
<div className="flex items-center gap-[10px]">
|
|
9
|
+
<div className="flex-shrink-0 rounded-full">
|
|
10
|
+
<div className="relative h-full w-full">
|
|
11
|
+
<DaeryunLogoIcon width={24} height={24} />
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<span className="dr_talk_subtitle_medium text-drTalkBlack">법무법인(유한)대륜</span>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div className="flex items-end pl-[34px]">
|
|
18
|
+
<ChatWrapper isOperator={true} className="!border-[0px] !px-[0px]">
|
|
19
|
+
<div className="flex h-[36px] items-center ">
|
|
20
|
+
<div className="flex animate-pulse space-x-2 rounded-full ">
|
|
21
|
+
<div className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale2 "></div>
|
|
22
|
+
<div
|
|
23
|
+
className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale3"
|
|
24
|
+
style={{ animationDelay: '0.2s' }}
|
|
25
|
+
></div>
|
|
26
|
+
<div
|
|
27
|
+
className="h-[8px] w-[8px] animate-bounce rounded-full bg-drTalkGrayscale3"
|
|
28
|
+
style={{ animationDelay: '0.4s' }}
|
|
29
|
+
></div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</ChatWrapper>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default TypingComp;
|
|
@@ -74,6 +74,7 @@ type DaeryuntalkContextType = {
|
|
|
74
74
|
setMessageObject: (obj: MessageObject | null) => void;
|
|
75
75
|
setWorkFlowStack: (arr: string[]) => void;
|
|
76
76
|
retryInitData: () => void;
|
|
77
|
+
isTyping: boolean;
|
|
77
78
|
};
|
|
78
79
|
declare const DaeryuntalkContext: React.Context<DaeryuntalkContextType>;
|
|
79
80
|
type DaeryuntalkProviderProps = {
|
|
@@ -56,7 +56,8 @@ const DaeryuntalkContext = createContext({
|
|
|
56
56
|
retryInquiryMain: () => { },
|
|
57
57
|
setMessageObject: () => { },
|
|
58
58
|
setWorkFlowStack: () => { },
|
|
59
|
-
retryInitData: () => { }
|
|
59
|
+
retryInitData: () => { },
|
|
60
|
+
isTyping: false
|
|
60
61
|
});
|
|
61
62
|
export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
62
63
|
const [inquiryStatus, setInquiryStatus] = useState('');
|
|
@@ -76,6 +77,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
|
76
77
|
const socketRef = useRef(null);
|
|
77
78
|
// 히스토리 리스트
|
|
78
79
|
const [historyList, setHistoryList] = useState([]);
|
|
80
|
+
// 채팅 입력중 UI여부
|
|
81
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
79
82
|
// 소켓 관련 API + 채팅 시작
|
|
80
83
|
const { initializeDaeryuntalk, sendHeartbeat, sendInquiryJoined, sendInquiryLeft, sendHistoryEntered, sendHistoryLeft, sendInquiryWatching, retryInquiryMain, retryInitData } = useSocketEventHandler({
|
|
81
84
|
setIsConnected,
|
|
@@ -90,7 +93,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
|
90
93
|
historyList,
|
|
91
94
|
inquiryMainData,
|
|
92
95
|
isMobile,
|
|
93
|
-
setIsAuthenticated
|
|
96
|
+
setIsAuthenticated,
|
|
97
|
+
setIsTyping
|
|
94
98
|
});
|
|
95
99
|
// MSG15591497825895676
|
|
96
100
|
// 채팅 관련
|
|
@@ -153,7 +157,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile }) => {
|
|
|
153
157
|
retryInquiryMain,
|
|
154
158
|
setMessageObject,
|
|
155
159
|
setWorkFlowStack,
|
|
156
|
-
retryInitData
|
|
160
|
+
retryInitData,
|
|
161
|
+
isTyping
|
|
157
162
|
}}>
|
|
158
163
|
{children}
|
|
159
164
|
</DaeryuntalkContext.Provider>);
|
|
@@ -79,6 +79,7 @@ type DaeryuntalkContextType = {
|
|
|
79
79
|
setMessageObject: (obj: MessageObject | null) => void;
|
|
80
80
|
setWorkFlowStack: (arr: string[]) => void;
|
|
81
81
|
retryInitData: () => void;
|
|
82
|
+
isTyping: boolean;
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
// 기본값으로 컨텍스트 생성
|
|
@@ -125,7 +126,8 @@ const DaeryuntalkContext = createContext<DaeryuntalkContextType>({
|
|
|
125
126
|
retryInquiryMain: () => {},
|
|
126
127
|
setMessageObject: () => {},
|
|
127
128
|
setWorkFlowStack: () => {},
|
|
128
|
-
retryInitData: () => {}
|
|
129
|
+
retryInitData: () => {},
|
|
130
|
+
isTyping: false
|
|
129
131
|
});
|
|
130
132
|
|
|
131
133
|
// 프로바이더 컴포넌트 생성
|
|
@@ -158,6 +160,9 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
158
160
|
// 히스토리 리스트
|
|
159
161
|
const [historyList, setHistoryList] = useState<History[]>([]);
|
|
160
162
|
|
|
163
|
+
// 채팅 입력중 UI여부
|
|
164
|
+
const [isTyping, setIsTyping] = useState(false);
|
|
165
|
+
|
|
161
166
|
// 소켓 관련 API + 채팅 시작
|
|
162
167
|
const {
|
|
163
168
|
initializeDaeryuntalk,
|
|
@@ -182,7 +187,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
182
187
|
historyList,
|
|
183
188
|
inquiryMainData,
|
|
184
189
|
isMobile,
|
|
185
|
-
setIsAuthenticated
|
|
190
|
+
setIsAuthenticated,
|
|
191
|
+
setIsTyping
|
|
186
192
|
});
|
|
187
193
|
|
|
188
194
|
// MSG15591497825895676
|
|
@@ -263,7 +269,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
263
269
|
retryInquiryMain,
|
|
264
270
|
setMessageObject,
|
|
265
271
|
setWorkFlowStack,
|
|
266
|
-
retryInitData
|
|
272
|
+
retryInitData,
|
|
273
|
+
isTyping
|
|
267
274
|
}}
|
|
268
275
|
>
|
|
269
276
|
{children}
|
|
@@ -39,18 +39,19 @@ const MobileViewer = ({ imageViewerMessage, handleDownload, currentIndex, setCur
|
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
41
|
{/* 해당 공간은 중앙 배치 및 화면작아지면 스크롤 */}
|
|
42
|
+
|
|
42
43
|
<div className={`mx-[20px] flex h-[calc(100dvh-68px-155px)] flex-col items-center justify-center overflow-auto`}>
|
|
43
|
-
<div className="group relative flex w-full items-center justify-center overflow-auto">
|
|
44
|
-
<Swiper spaceBetween={
|
|
44
|
+
<div className="group relative flex h-full w-full items-center justify-center overflow-auto">
|
|
45
|
+
<Swiper spaceBetween={2} slidesPerView={1} initialSlide={currentIndex} onSlideChange={swiper => {
|
|
45
46
|
setCurrentIndex(swiper.activeIndex);
|
|
46
47
|
setRotation(0);
|
|
47
48
|
setZoomLevel(3);
|
|
48
49
|
}} onSwiper={swiper => {
|
|
49
50
|
thumbSwiperRef.current = swiper;
|
|
50
|
-
}} allowTouchMove={previewImages.length > 1} className="w-full">
|
|
51
|
-
{previewImages.map((img, idx) => (<SwiperSlide key={idx} className="flex items-center justify-center
|
|
52
|
-
<div className="relative flex h-
|
|
53
|
-
<Image src={img.url} alt={img.file.name} width={500} height={500} className="
|
|
51
|
+
}} allowTouchMove={previewImages.length > 1} className="!h-full w-full">
|
|
52
|
+
{previewImages.map((img, idx) => (<SwiperSlide key={idx} className="flex !h-full items-center justify-center">
|
|
53
|
+
<div className="relative flex h-full w-full items-center justify-center">
|
|
54
|
+
<Image src={img.url} alt={img.file.name} width={500} height={500} className="h-auto max-h-full w-auto max-w-full rounded-[20px] object-contain" unoptimized/>
|
|
54
55
|
</div>
|
|
55
56
|
</SwiperSlide>))}
|
|
56
57
|
</Swiper>
|
|
@@ -66,12 +66,13 @@ const MobileViewer = ({
|
|
|
66
66
|
</div>
|
|
67
67
|
</div>
|
|
68
68
|
{/* 해당 공간은 중앙 배치 및 화면작아지면 스크롤 */}
|
|
69
|
+
|
|
69
70
|
<div
|
|
70
71
|
className={`mx-[20px] flex h-[calc(100dvh-68px-155px)] flex-col items-center justify-center overflow-auto`}
|
|
71
72
|
>
|
|
72
|
-
<div className="group relative flex w-full items-center justify-center overflow-auto">
|
|
73
|
+
<div className="group relative flex h-full w-full items-center justify-center overflow-auto">
|
|
73
74
|
<Swiper
|
|
74
|
-
spaceBetween={
|
|
75
|
+
spaceBetween={2}
|
|
75
76
|
slidesPerView={1}
|
|
76
77
|
initialSlide={currentIndex}
|
|
77
78
|
onSlideChange={swiper => {
|
|
@@ -83,17 +84,17 @@ const MobileViewer = ({
|
|
|
83
84
|
thumbSwiperRef.current = swiper;
|
|
84
85
|
}}
|
|
85
86
|
allowTouchMove={previewImages.length > 1}
|
|
86
|
-
className="w-full"
|
|
87
|
+
className="!h-full w-full"
|
|
87
88
|
>
|
|
88
89
|
{previewImages.map((img, idx) => (
|
|
89
|
-
<SwiperSlide key={idx} className="flex items-center justify-center
|
|
90
|
-
<div className="relative flex h-
|
|
90
|
+
<SwiperSlide key={idx} className="flex !h-full items-center justify-center">
|
|
91
|
+
<div className="relative flex h-full w-full items-center justify-center">
|
|
91
92
|
<Image
|
|
92
93
|
src={img.url}
|
|
93
94
|
alt={img.file.name}
|
|
94
95
|
width={500}
|
|
95
96
|
height={500}
|
|
96
|
-
className="
|
|
97
|
+
className="h-auto max-h-full w-auto max-w-full rounded-[20px] object-contain"
|
|
97
98
|
unoptimized
|
|
98
99
|
/>
|
|
99
100
|
</div>
|
|
@@ -18,5 +18,7 @@ export declare enum MessageSocketType {
|
|
|
18
18
|
/** 할당된 상담원이 해제됨 */
|
|
19
19
|
INQUIRY_UNASSIGNED = "inquiry.unassigned",
|
|
20
20
|
/** 고객 정보가 갱신됨 */
|
|
21
|
-
CUSTOMER_INFO_UPDATED = "customer.info.updated"
|
|
21
|
+
CUSTOMER_INFO_UPDATED = "customer.info.updated",
|
|
22
|
+
/** 타이핑중임 */
|
|
23
|
+
TYPING_STARTED = "typing.started"
|
|
22
24
|
}
|
|
@@ -16,8 +16,9 @@ interface props {
|
|
|
16
16
|
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
17
17
|
isMobile: boolean;
|
|
18
18
|
setIsAuthenticated: Dispatch<SetStateAction<boolean>>;
|
|
19
|
+
setIsTyping: Dispatch<SetStateAction<boolean>>;
|
|
19
20
|
}
|
|
20
|
-
export declare const useSocketEventHandler: ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated }: props) => {
|
|
21
|
+
export declare const useSocketEventHandler: ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping }: props) => {
|
|
21
22
|
initializeDaeryuntalk: (hashValue: string | null, isOpen: boolean, version?: string) => Promise<import("../../_api/daeryuntalk/type/response").IDaeryunTalkResponseWrapper<IChatInquiryMainDataResponse> | null | undefined>;
|
|
22
23
|
sendHeartbeat: () => void;
|
|
23
24
|
sendInquiryJoined: (chatInquiryNumber: string) => void;
|
|
@@ -7,15 +7,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useCallback } from 'react';
|
|
10
|
+
import { useCallback, useRef } from 'react';
|
|
11
11
|
import { authenticateUser, getChatInquiryMain, getHistoryList, initializeDaeryuntalk as apiInitializeDaeryuntalk, TEST_CENTER_CODE } from '../../_api/daeryuntalk';
|
|
12
12
|
import { convertApiMessageToUiMessage, convertSocketObjectToUiMessage } from '../../_lib';
|
|
13
13
|
import { MessageSocketType } from '../../_enums/socket_type';
|
|
14
14
|
import { InquiryStatusEnum } from '../../_enums/ask-status';
|
|
15
15
|
import { useDaeryunTalkToast } from '../../Toast/DaeryuntalkToastProvider';
|
|
16
16
|
import { getErrorMessageMap } from '../../_enums/error';
|
|
17
|
-
export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated }) => {
|
|
17
|
+
export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessages, setInquiryMainData, socketRef, setWorkFlowStack, setMessageObject, setInquiryStatus, setHistoryList, historyList, inquiryMainData, isMobile, setIsAuthenticated, setIsTyping }) => {
|
|
18
|
+
const typingTimeoutRef = useRef(null);
|
|
18
19
|
const toast = useDaeryunTalkToast();
|
|
20
|
+
const handleTypingStarted = () => {
|
|
21
|
+
setIsTyping(true);
|
|
22
|
+
if (typingTimeoutRef.current) {
|
|
23
|
+
clearTimeout(typingTimeoutRef.current);
|
|
24
|
+
}
|
|
25
|
+
// 일정 시간 타이핑 이벤트 없으면 UI 제거
|
|
26
|
+
typingTimeoutRef.current = setTimeout(() => {
|
|
27
|
+
setIsTyping(false);
|
|
28
|
+
}, 5000);
|
|
29
|
+
};
|
|
19
30
|
/**
|
|
20
31
|
* 1. heartbeat
|
|
21
32
|
* - 목적: 사용자의 이탈 여부를 추적하기 위한 주기적 하트비트 전송
|
|
@@ -211,6 +222,11 @@ export const useSocketEventHandler = ({ setIsConnected, setIsLoading, setMessage
|
|
|
211
222
|
// 고객 정보가 갱신됨
|
|
212
223
|
if (data.type === MessageSocketType.CUSTOMER_INFO_UPDATED) {
|
|
213
224
|
}
|
|
225
|
+
//
|
|
226
|
+
if (data.type === MessageSocketType.TYPING_STARTED) {
|
|
227
|
+
const payload = data.payload;
|
|
228
|
+
handleTypingStarted();
|
|
229
|
+
}
|
|
214
230
|
}
|
|
215
231
|
catch (error) {
|
|
216
232
|
console.error('[DaeryuntalkContext] 웹소켓 메시지 처리 오류:', error);
|
|
@@ -32,6 +32,7 @@ interface props {
|
|
|
32
32
|
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
33
33
|
isMobile: boolean;
|
|
34
34
|
setIsAuthenticated: Dispatch<SetStateAction<boolean>>;
|
|
35
|
+
setIsTyping: Dispatch<SetStateAction<boolean>>;
|
|
35
36
|
}
|
|
36
37
|
export const useSocketEventHandler = ({
|
|
37
38
|
setIsConnected,
|
|
@@ -46,9 +47,25 @@ export const useSocketEventHandler = ({
|
|
|
46
47
|
historyList,
|
|
47
48
|
inquiryMainData,
|
|
48
49
|
isMobile,
|
|
49
|
-
setIsAuthenticated
|
|
50
|
+
setIsAuthenticated,
|
|
51
|
+
setIsTyping
|
|
50
52
|
}: props) => {
|
|
53
|
+
const typingTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
51
54
|
const toast = useDaeryunTalkToast();
|
|
55
|
+
|
|
56
|
+
const handleTypingStarted = () => {
|
|
57
|
+
setIsTyping(true);
|
|
58
|
+
|
|
59
|
+
if (typingTimeoutRef.current) {
|
|
60
|
+
clearTimeout(typingTimeoutRef.current);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 일정 시간 타이핑 이벤트 없으면 UI 제거
|
|
64
|
+
typingTimeoutRef.current = setTimeout(() => {
|
|
65
|
+
setIsTyping(false);
|
|
66
|
+
}, 5000);
|
|
67
|
+
};
|
|
68
|
+
|
|
52
69
|
/**
|
|
53
70
|
* 1. heartbeat
|
|
54
71
|
* - 목적: 사용자의 이탈 여부를 추적하기 위한 주기적 하트비트 전송
|
|
@@ -291,6 +308,14 @@ export const useSocketEventHandler = ({
|
|
|
291
308
|
// 고객 정보가 갱신됨
|
|
292
309
|
if (data.type === MessageSocketType.CUSTOMER_INFO_UPDATED) {
|
|
293
310
|
}
|
|
311
|
+
//
|
|
312
|
+
if (data.type === MessageSocketType.TYPING_STARTED) {
|
|
313
|
+
const payload: {
|
|
314
|
+
chat_inquiry_number: string;
|
|
315
|
+
user_key: string;
|
|
316
|
+
} = data.payload;
|
|
317
|
+
handleTypingStarted();
|
|
318
|
+
}
|
|
294
319
|
} catch (error) {
|
|
295
320
|
console.error('[DaeryuntalkContext] 웹소켓 메시지 처리 오류:', error);
|
|
296
321
|
}
|
|
@@ -10,20 +10,13 @@ export const useChatSocketState = (chatInquiryNumber, viewState, sendInquiryWatc
|
|
|
10
10
|
}, [sendHeartbeat]);
|
|
11
11
|
// 2. 뷰 상태에 따른 watch / leave
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
if (
|
|
14
|
-
return;
|
|
15
|
-
if (viewState === 'conversation') {
|
|
13
|
+
if (viewState === 'conversation' && chatInquiryNumber) {
|
|
16
14
|
sendInquiryJoined(chatInquiryNumber);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, 5000);
|
|
21
|
-
return () => clearInterval(watchingInterval);
|
|
15
|
+
return () => {
|
|
16
|
+
sendInquiryLeft(chatInquiryNumber);
|
|
17
|
+
};
|
|
22
18
|
}
|
|
23
|
-
|
|
24
|
-
sendInquiryLeft(chatInquiryNumber);
|
|
25
|
-
}
|
|
26
|
-
}, [chatInquiryNumber, viewState, sendInquiryWatching, sendInquiryLeft]);
|
|
19
|
+
}, [viewState, chatInquiryNumber]);
|
|
27
20
|
// 소켓
|
|
28
21
|
useEffect(() => {
|
|
29
22
|
if (isConnected && isAuthenticated && viewState === 'history') {
|
|
@@ -25,21 +25,14 @@ export const useChatSocketState = (
|
|
|
25
25
|
|
|
26
26
|
// 2. 뷰 상태에 따른 watch / leave
|
|
27
27
|
useEffect(() => {
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
if (viewState === 'conversation') {
|
|
28
|
+
if (viewState === 'conversation' && chatInquiryNumber) {
|
|
31
29
|
sendInquiryJoined(chatInquiryNumber);
|
|
32
|
-
sendInquiryWatching(chatInquiryNumber);
|
|
33
|
-
|
|
34
|
-
const watchingInterval = setInterval(() => {
|
|
35
|
-
sendInquiryWatching(chatInquiryNumber);
|
|
36
|
-
}, 5000);
|
|
37
30
|
|
|
38
|
-
return () =>
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
return () => {
|
|
32
|
+
sendInquiryLeft(chatInquiryNumber);
|
|
33
|
+
};
|
|
41
34
|
}
|
|
42
|
-
}, [
|
|
35
|
+
}, [viewState, chatInquiryNumber]);
|
|
43
36
|
|
|
44
37
|
// 소켓
|
|
45
38
|
useEffect(() => {
|
package/dist/styles/globals.css
CHANGED
|
@@ -2275,6 +2275,10 @@ video {
|
|
|
2275
2275
|
height: 83px !important;
|
|
2276
2276
|
}
|
|
2277
2277
|
|
|
2278
|
+
.\!h-full {
|
|
2279
|
+
height: 100% !important;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2278
2282
|
.h-0 {
|
|
2279
2283
|
height: 0px;
|
|
2280
2284
|
}
|
|
@@ -5250,11 +5254,6 @@ video {
|
|
|
5250
5254
|
background-color: rgb(118 118 118 / var(--tw-bg-opacity, 1));
|
|
5251
5255
|
}
|
|
5252
5256
|
|
|
5253
|
-
.bg-\[\#777777\] {
|
|
5254
|
-
--tw-bg-opacity: 1;
|
|
5255
|
-
background-color: rgb(119 119 119 / var(--tw-bg-opacity, 1));
|
|
5256
|
-
}
|
|
5257
|
-
|
|
5258
5257
|
.bg-\[\#8A1729\] {
|
|
5259
5258
|
--tw-bg-opacity: 1;
|
|
5260
5259
|
background-color: rgb(138 23 41 / var(--tw-bg-opacity, 1));
|
|
@@ -5290,11 +5289,6 @@ video {
|
|
|
5290
5289
|
background-color: rgb(185 185 185 / var(--tw-bg-opacity, 1));
|
|
5291
5290
|
}
|
|
5292
5291
|
|
|
5293
|
-
.bg-\[\#C2C2C2\] {
|
|
5294
|
-
--tw-bg-opacity: 1;
|
|
5295
|
-
background-color: rgb(194 194 194 / var(--tw-bg-opacity, 1));
|
|
5296
|
-
}
|
|
5297
|
-
|
|
5298
5292
|
.bg-\[\#C6F5CA\] {
|
|
5299
5293
|
--tw-bg-opacity: 1;
|
|
5300
5294
|
background-color: rgb(198 245 202 / var(--tw-bg-opacity, 1));
|
|
@@ -5510,6 +5504,16 @@ video {
|
|
|
5510
5504
|
background-color: rgb(170 29 54 / var(--tw-bg-opacity, 1));
|
|
5511
5505
|
}
|
|
5512
5506
|
|
|
5507
|
+
.bg-drTalkGrayscale2 {
|
|
5508
|
+
--tw-bg-opacity: 1;
|
|
5509
|
+
background-color: rgb(119 119 119 / var(--tw-bg-opacity, 1));
|
|
5510
|
+
}
|
|
5511
|
+
|
|
5512
|
+
.bg-drTalkGrayscale3 {
|
|
5513
|
+
--tw-bg-opacity: 1;
|
|
5514
|
+
background-color: rgb(194 194 194 / var(--tw-bg-opacity, 1));
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5513
5517
|
.bg-drTalkGrayscale4 {
|
|
5514
5518
|
--tw-bg-opacity: 1;
|
|
5515
5519
|
background-color: rgb(237 237 237 / var(--tw-bg-opacity, 1));
|
|
@@ -5932,6 +5936,11 @@ video {
|
|
|
5932
5936
|
padding: 8px;
|
|
5933
5937
|
}
|
|
5934
5938
|
|
|
5939
|
+
.\!px-\[0px\] {
|
|
5940
|
+
padding-left: 0px !important;
|
|
5941
|
+
padding-right: 0px !important;
|
|
5942
|
+
}
|
|
5943
|
+
|
|
5935
5944
|
.\!py-\[12\.5px\] {
|
|
5936
5945
|
padding-top: 12.5px !important;
|
|
5937
5946
|
padding-bottom: 12.5px !important;
|