@daeryun/dr_components 0.8.48 → 0.8.49

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.
@@ -10,7 +10,7 @@ import { useHistoryView } from './_hooks/view/useHistoryView';
10
10
  import { useHomeView } from './_hooks/view/useHomeView';
11
11
  import FixedErrorBox from './FixedErrorBox';
12
12
  const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
13
- const [viewState, setViewState] = useState('home');
13
+ const [viewState, setViewState] = useState(hashValue ? 'conversation' : 'home');
14
14
  const [isLoading, setIsLoading] = useState(false);
15
15
  const { isConnected, isAuthenticated, historyList, inquiryMainData, chatInquiryNumber, startChat } = useDaeryuntalk();
16
16
  // 소켓 이벤트
@@ -52,6 +52,7 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
52
52
  goGetHistoryList({});
53
53
  }
54
54
  }, [viewState, isAuthenticated]);
55
+ console.log('isConnected', isConnected);
55
56
  const renderWithNavigation = (content, activeView) => {
56
57
  return (<main className={`
57
58
  relative flex justify-end
@@ -83,7 +84,7 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
83
84
  </div>
84
85
  </div>
85
86
  <ToastRenderer />
86
- <FixedErrorBox isError={isConnected !== null && !isConnected}/>
87
+ <FixedErrorBox isError={isConnected === null ? false : !isConnected}/>
87
88
  </main>);
88
89
  };
89
90
  // 채팅 문의 창
@@ -30,7 +30,7 @@ type ChatHomeViewProps = {
30
30
  onClose: () => void;
31
31
  };
32
32
  const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobile, isHash }) => {
33
- const [viewState, setViewState] = useState<ViewState>('home');
33
+ const [viewState, setViewState] = useState<ViewState>(hashValue ? 'conversation' : 'home');
34
34
  const [isLoading, setIsLoading] = useState<boolean>(false);
35
35
  const { isConnected, isAuthenticated, historyList, inquiryMainData, chatInquiryNumber, startChat } =
36
36
  useDaeryuntalk();
@@ -102,6 +102,7 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
102
102
  goGetHistoryList({});
103
103
  }
104
104
  }, [viewState, isAuthenticated]);
105
+ console.log('isConnected', isConnected);
105
106
 
106
107
  const renderWithNavigation = (content: React.ReactNode, activeView: 'home' | 'history' | 'conversation') => {
107
108
  return (
@@ -150,7 +151,7 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
150
151
  </div>
151
152
  </div>
152
153
  <ToastRenderer />
153
- <FixedErrorBox isError={isConnected !== null && !isConnected} />
154
+ <FixedErrorBox isError={isConnected === null ? false : !isConnected} />
154
155
  </main>
155
156
  );
156
157
  };
@@ -69,7 +69,7 @@ export const DaeryuntalkProvider = ({ children, propsTel }) => {
69
69
  const [isNextPage, setIsNextPage] = useState(null);
70
70
  const [chatInquiryNumber, setChatInquiryNumber] = useState(null);
71
71
  // 전역 소켓 연결 상태
72
- const [isConnected, setIsConnected] = useState(false);
72
+ const [isConnected, setIsConnected] = useState(null);
73
73
  const [isLoading, setIsLoading] = useState(false);
74
74
  const [inquiryMainData, setInquiryMainData] = useState(null);
75
75
  const socketRef = useRef(null);
@@ -146,7 +146,7 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
146
146
  const [chatInquiryNumber, setChatInquiryNumber] = useState<string | null>(null);
147
147
 
148
148
  // 전역 소켓 연결 상태
149
- const [isConnected, setIsConnected] = useState<boolean | null>(false);
149
+ const [isConnected, setIsConnected] = useState<boolean | null>(null);
150
150
  const [isLoading, setIsLoading] = useState<boolean>(false);
151
151
  const [inquiryMainData, setInquiryMainData] = useState<IChatInquiryMainDataResponse | null>(null);
152
152