@capillarytech/creatives-library 7.12.59 → 7.12.61

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.
@@ -117,6 +117,7 @@ export const Whatsapp = (props) => {
117
117
  const [addedVarCount, setAddedVarCount] = useState(0);
118
118
  const [accountId, setAccountId] = useState('');
119
119
  const [accessToken, setAccessToken] = useState('');
120
+ const [accountName, setAccountName] = useState('');
120
121
  const [host, setHost] = useState('');
121
122
  const [spin, setSpin] = useState(false);
122
123
  const [unsubscribeRequired, setUnsubscribeRequired] = useState(false);
@@ -160,16 +161,15 @@ export const Whatsapp = (props) => {
160
161
  useEffect(() => {
161
162
  const accountObj = accountData.selectedWhatsappAccount || {};
162
163
  if (!isEmpty(accountObj)) {
163
- const { connectionProperties = {}, hostName = '' } = accountObj;
164
- if (hostName === HOST_KARIX) {
165
- const { authToken = '', wabaId = '' } = connectionProperties;
166
- setAccessToken(authToken);
167
- setAccountId(wabaId);
168
- } else {
169
- const { auth_token = '', account_sid = '' } = connectionProperties;
170
- setAccessToken(auth_token);
171
- setAccountId(account_sid);
172
- }
164
+ const {
165
+ sourceAccountIdentifier = '',
166
+ configs = {},
167
+ name = '',
168
+ hostName = '',
169
+ } = accountObj;
170
+ setAccountId(sourceAccountIdentifier);
171
+ setAccessToken(configs.accessToken || '');
172
+ setAccountName(name);
173
173
  setHost(hostName);
174
174
  }
175
175
  }, [accountData.selectedWhatsappAccount]);
@@ -1347,6 +1347,7 @@ export const Whatsapp = (props) => {
1347
1347
  }),
1348
1348
  }}
1349
1349
  whatsappContentLen={computeTextLength()}
1350
+ whatsappAccountName={accountName}
1350
1351
  />
1351
1352
  );
1352
1353
  };