@daeryun/dr_components 0.9.27 → 0.9.28

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.
@@ -79,9 +79,7 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000' }) => {
79
79
  const params = new URLSearchParams(raw);
80
80
  const token = params.get('token');
81
81
  const code = params.get('centerCode') || '';
82
- if (centerCode) {
83
- setHashValue(token);
84
- }
82
+ setHashValue(token);
85
83
  setCurrentCenterCode(code);
86
84
  }
87
85
  else {
@@ -103,8 +101,8 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000' }) => {
103
101
  </Head>)}
104
102
  <DaeryuntalkToastProvider>
105
103
  <ViewportHandler />
106
- <DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={centerCode}>
107
- {isMobile ? (isOpen || !centerCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)) : !centerCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)}
104
+ <DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={currentCenterCode || ''}>
105
+ {isMobile ? (isOpen || !currentCenterCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)) : !currentCenterCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)}
108
106
  <ChatWidget isOpen={hashValue ? true : isOpen} isMobile={isMobile} onClose={closeModal} hashValue={hashValue} setHashValue={setHashValue} animationState={animationState}/>
109
107
  </DaeryuntalkProvider>
110
108
  </DaeryuntalkToastProvider>
@@ -99,9 +99,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
99
99
  const token = params.get('token');
100
100
  const code = params.get('centerCode') || '';
101
101
 
102
- if (centerCode) {
103
- setHashValue(token);
104
- }
102
+ setHashValue(token);
105
103
  setCurrentCenterCode(code);
106
104
  } else {
107
105
  setHashValue(raw);
@@ -126,9 +124,14 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
126
124
  )}
127
125
  <DaeryuntalkToastProvider>
128
126
  <ViewportHandler />
129
- <DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={centerCode}>
127
+ <DaeryuntalkProvider
128
+ propsTel={tel}
129
+ isMobile={isMobile}
130
+ onClose={closeModal}
131
+ centerCode={currentCenterCode || ''}
132
+ >
130
133
  {isMobile ? (
131
- isOpen || !centerCode ? null : (
134
+ isOpen || !currentCenterCode ? null : (
132
135
  <ChatButton
133
136
  isOpen={isOpen}
134
137
  isMobile={isMobile}
@@ -136,7 +139,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
136
139
  onClick={toggleChat}
137
140
  />
138
141
  )
139
- ) : !centerCode ? null : (
142
+ ) : !currentCenterCode ? null : (
140
143
  <ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat} />
141
144
  )}
142
145
  <ChatWidget