@copart/ops-tool-kit 1.12.4 → 1.12.5-alpha.0

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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$r = "@copart/ops-tool-kit";
50
- const version$8 = "1.12.4";
50
+ const version$8 = "1.12.5-alpha.0";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -69652,20 +69652,31 @@ var AppFrame = function AppFrame(props) {
69652
69652
  var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
69653
69653
  var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
69654
69654
  var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
69655
- console.log("***chatBotEnabled=", chatBotEnabled, coreAppConfig);
69656
- console.log("***isCoreRoute=", isCoreRoute, enableChatBot, window.location.pathname, !window.location.pathname.includes('embedded'));
69657
69655
  setChatBotEnabled(chatBotEnabled);
69658
69656
  chatBotEnabledRef.current = chatBotEnabled;
69659
69657
  };
69658
+ React.useEffect(function () {
69659
+ // Check if config is not loaded, start polling
69660
+ var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
69661
+ if (!coreAppConfig || Object.keys(coreAppConfig).length === 0) {
69662
+ // Poll for config until it's available
69663
+ var pollInterval = setInterval(function () {
69664
+ var config = storage$1.getLocalItem('opsportal-core:config');
69665
+ if (config && Object.keys(config).length > 0) {
69666
+ setChatBotEnableStatus();
69667
+ clearInterval(pollInterval);
69668
+ }
69669
+ }, 100);
69660
69670
 
69661
- // useEffect(() => {
69662
- // setChatBotEnableStatus()
69663
-
69664
- // setTimeout(()=>{ // if storage not loaded on first time login
69665
- // setChatBotEnableStatus()
69666
- // },1000)
69667
- // }, [])
69668
-
69671
+ // Stop polling after 5 seconds
69672
+ setTimeout(function () {
69673
+ clearInterval(pollInterval);
69674
+ }, 5000);
69675
+ return function () {
69676
+ clearInterval(pollInterval);
69677
+ };
69678
+ }
69679
+ }, []);
69669
69680
  React.useEffect(function () {
69670
69681
  if (appBarMounted) {
69671
69682
  var event = new Event('localStorageChanged');
@@ -69677,7 +69688,6 @@ var AppFrame = function AppFrame(props) {
69677
69688
  if (props.env) {
69678
69689
  window.toolkitEnv = props.env;
69679
69690
  }
69680
- console.log('***props=', props.location.pathname);
69681
69691
  setChatBotEnableStatus();
69682
69692
  }, [props]);
69683
69693
  var authGuardProps = _objectSpread2(_objectSpread2({}, props), {}, {