@mxenabled/connect-widget 0.20.0 → 0.20.1

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.es.js CHANGED
@@ -9146,6 +9146,14 @@ function _additionalProductReset(state) {
9146
9146
  const { addVerificationData, addAggregationData, additionalProductReset } = configSlice.actions;
9147
9147
  const configSlice$1 = configSlice.reducer;
9148
9148
 
9149
+ const ACTIONABLE_ERROR_CODES = {
9150
+ NO_ELIGIBLE_ACCOUNTS: 1e3
9151
+ };
9152
+ const ACTIVE_ACTIONABLE_ERROR_CODES = Object.values(ACTIONABLE_ERROR_CODES);
9153
+ const canHandleActionableError = (errorCode) => {
9154
+ return ACTIVE_ACTIONABLE_ERROR_CODES.includes(errorCode);
9155
+ };
9156
+
9149
9157
  const defaultState$1 = {
9150
9158
  error: null,
9151
9159
  // The most recent job request error, if any
@@ -9552,7 +9560,7 @@ function getStartingStep(members, member, microdeposit, config, institution, wid
9552
9560
  }
9553
9561
  function getStepFromMember(member) {
9554
9562
  const connection_status = member.connection_status;
9555
- if (member?.most_recent_job_detail_code || hasNoSingleAccountSelectOptions(member))
9563
+ if (member?.most_recent_job_detail_code && canHandleActionableError(member?.most_recent_job_detail_code) || hasNoSingleAccountSelectOptions(member))
9556
9564
  return STEPS.ACTIONABLE_ERROR;
9557
9565
  else if (connection_status === ReadableStatuses$1.CHALLENGED)
9558
9566
  return STEPS.MFA;
@@ -72071,10 +72079,6 @@ LoginError.propTypes = {
72071
72079
  };
72072
72080
  LoginError.displayName = "LoginError";
72073
72081
 
72074
- const ACTIONABLE_ERROR_CODES = {
72075
- NO_ELIGIBLE_ACCOUNTS: 1e3
72076
- };
72077
-
72078
72082
  const ActionableError = () => {
72079
72083
  const postMessageFunctions = useContext(PostMessageContext);
72080
72084
  const institution = useSelector((state) => state.connect.selectedInstitution);
@@ -77482,9 +77486,8 @@ const RenderConnectStep = (props) => {
77482
77486
  }
77483
77487
  );
77484
77488
  } else if (step === STEPS.ACTIONABLE_ERROR) {
77485
- connectStepView = [ACTIONABLE_ERROR_CODES.NO_ELIGIBLE_ACCOUNTS].includes(
77486
- currentMember?.most_recent_job_detail_code ?? -1
77487
- ) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ActionableError, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
77489
+ const jobDetailCode = currentMember?.most_recent_job_detail_code ?? null;
77490
+ connectStepView = canHandleActionableError(jobDetailCode) ? /* @__PURE__ */ jsxRuntimeExports.jsx(ActionableError, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
77488
77491
  LoginError,
77489
77492
  {
77490
77493
  institution: selectedInstitution,