@salesgenterp/ui-components 0.4.402 → 0.4.403

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/index.js CHANGED
@@ -4257,8 +4257,6 @@ var AccountDetails = function AccountDetails(_ref) {
4257
4257
  _ref$imgNotFoundUrl = _ref.imgNotFoundUrl,
4258
4258
  imgNotFoundUrl = _ref$imgNotFoundUrl === void 0 ? noImgAvailable$1 : _ref$imgNotFoundUrl,
4259
4259
  hideInvoiceAction = _ref.hideInvoiceAction,
4260
- _ref$payInvoiceFromDa = _ref.payInvoiceFromDashboard,
4261
- payInvoiceFromDashboard = _ref$payInvoiceFromDa === void 0 ? true : _ref$payInvoiceFromDa,
4262
4260
  _ref$removeSocialLink = _ref.removeSocialLinks,
4263
4261
  removeSocialLinks = _ref$removeSocialLink === void 0 ? false : _ref$removeSocialLink;
4264
4262
  serviceApiEndPoint = serviceApiEndPoint || (apiEndPoint === null || apiEndPoint === void 0 ? void 0 : apiEndPoint.replace('/api', '/services/pdf'));
@@ -4287,17 +4285,20 @@ var AccountDetails = function AccountDetails(_ref) {
4287
4285
  })) === null || _storeData$find === void 0 ? void 0 : _storeData$find.id) || 2),
4288
4286
  defaultStoreId = _useState6[0],
4289
4287
  setDefaultStoreId = _useState6[1];
4290
- var _useState7 = React.useState({
4288
+ var _useState7 = React.useState(false),
4289
+ authoriseDotNet = _useState7[0],
4290
+ setAuthoriseDotNet = _useState7[1];
4291
+ var _useState8 = React.useState({
4291
4292
  primaryColor: primaryColor || '#424242',
4292
4293
  secondaryColor: secondaryColor || '#FFFFFF',
4293
4294
  backgroundColor: backgroundColor || '#F5F5F5',
4294
4295
  fontColor: fontColor || '#391111'
4295
4296
  }),
4296
- colors = _useState7[0],
4297
- setColors = _useState7[1];
4298
- var _useState8 = React.useState(path || 'dashboard'),
4299
- tabValue = _useState8[0],
4300
- setTabValue = _useState8[1];
4297
+ colors = _useState8[0],
4298
+ setColors = _useState8[1];
4299
+ var _useState9 = React.useState(path || 'dashboard'),
4300
+ tabValue = _useState9[0],
4301
+ setTabValue = _useState9[1];
4301
4302
  React.useEffect(function () {
4302
4303
  setTabValue(path || 'dashboard');
4303
4304
  }, [path]);
@@ -4328,32 +4329,43 @@ var AccountDetails = function AccountDetails(_ref) {
4328
4329
  React.useEffect(function () {
4329
4330
  (function () {
4330
4331
  try {
4331
- var _temp2 = function _temp2() {
4332
+ var _temp3 = function _temp3() {
4332
4333
  setDataLoading(false);
4333
4334
  };
4334
- setDataLoading(true);
4335
- var _temp = _catch(function () {
4336
- return Promise.resolve(API({
4337
- apiEndPoint: apiEndPoint,
4338
- token: token,
4339
- url: "/store"
4340
- })).then(function (data) {
4341
- var _data$map, _data$find;
4342
- setStoreData(data);
4343
- setSoreIdList((data === null || data === void 0 ? void 0 : (_data$map = data.map(function (data) {
4344
- return data === null || data === void 0 ? void 0 : data.id;
4345
- })) === null || _data$map === void 0 ? void 0 : _data$map.join(',')) || 1);
4346
- setDefaultStoreId((data === null || data === void 0 ? void 0 : (_data$find = data.find(function (data) {
4347
- return (data === null || data === void 0 ? void 0 : data.defaultStore) === true;
4348
- })) === null || _data$find === void 0 ? void 0 : _data$find.id) || 2);
4349
- });
4350
- }, function () {});
4351
- return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
4335
+ var _temp2 = function () {
4336
+ if (apiEndPoint && token) {
4337
+ setDataLoading(true);
4338
+ var _temp = _catch(function () {
4339
+ return Promise.resolve(API({
4340
+ apiEndPoint: apiEndPoint,
4341
+ token: token,
4342
+ url: "/store"
4343
+ })).then(function (data) {
4344
+ var _data$map, _data$find;
4345
+ setStoreData(data);
4346
+ setSoreIdList((data === null || data === void 0 ? void 0 : (_data$map = data.map(function (data) {
4347
+ return data === null || data === void 0 ? void 0 : data.id;
4348
+ })) === null || _data$map === void 0 ? void 0 : _data$map.join(',')) || 1);
4349
+ setDefaultStoreId((data === null || data === void 0 ? void 0 : (_data$find = data.find(function (data) {
4350
+ return (data === null || data === void 0 ? void 0 : data.defaultStore) === true;
4351
+ })) === null || _data$find === void 0 ? void 0 : _data$find.id) || 2);
4352
+ return Promise.resolve(getStoreFeature({
4353
+ apiEndPoint: apiEndPoint,
4354
+ token: token
4355
+ })).then(function (storeFeature) {
4356
+ setAuthoriseDotNet((storeFeature === null || storeFeature === void 0 ? void 0 : storeFeature.defaultPaymentProvider) === DEFAULT_PAYMENT_PROVIDER.AUTHORISE_DOT_NET);
4357
+ });
4358
+ });
4359
+ }, function () {});
4360
+ if (_temp && _temp.then) return _temp.then(function () {});
4361
+ }
4362
+ }();
4363
+ return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
4352
4364
  } catch (e) {
4353
4365
  Promise.reject(e);
4354
4366
  }
4355
4367
  })();
4356
- }, []);
4368
+ }, [token]);
4357
4369
  var handleColors = function handleColors(isNightMode) {
4358
4370
  isNightMode ? setColors({
4359
4371
  primaryColor: primaryColor || '#BF262D',
@@ -4398,7 +4410,7 @@ var AccountDetails = function AccountDetails(_ref) {
4398
4410
  hideDiscountImage: hideDiscountImage,
4399
4411
  imgNotFoundUrl: imgNotFoundUrl,
4400
4412
  hideInvoiceAction: hideInvoiceAction,
4401
- payInvoiceFromDashboard: payInvoiceFromDashboard,
4413
+ payInvoiceFromDashboard: authoriseDotNet,
4402
4414
  removeSocialLinks: removeSocialLinks
4403
4415
  });
4404
4416
  case 'myProfile':