@zeniai/client-epic-state 5.0.32-betaRD2 → 5.0.32-betaRD3

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.
@@ -9,7 +9,10 @@ const failureSnackbar = (reason) => openSnackbar({
9
9
  type: 'error',
10
10
  variables: [{ variableName: '__reason__', variableValue: reason }],
11
11
  });
12
- export const approveOAuthConsentEpic = (actions$, _state$, zeniAPI) => actions$.pipe(filter(approveOAuthConsent.match), switchMap((action) => {
12
+ export const approveOAuthConsentEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(approveOAuthConsent.match), switchMap((action) => {
13
+ if (state$.value.zeniOAuthViewState.fetchState === 'In-Progress') {
14
+ return from([]);
15
+ }
13
16
  const { userId, zeniSessionId, tenantId, clientId, redirectUri, codeChallenge, codeChallengeMethod, state, responseType, } = action.payload;
14
17
  const authHeaders = {
15
18
  'zeni-user-id': userId,
@@ -51,7 +54,8 @@ export const approveOAuthConsentEpic = (actions$, _state$, zeniAPI) => actions$.
51
54
  }
52
55
  return of(approveOAuthConsentSuccess({ redirectUrl }));
53
56
  }))), catchError((error) => {
54
- const networkErrorMessage = 'OAuth approve request failed: ' + JSON.stringify(error);
57
+ const errorDetail = error instanceof Error ? error.message : JSON.stringify(error);
58
+ const networkErrorMessage = 'OAuth approve request failed: ' + errorDetail;
55
59
  return from([
56
60
  approveOAuthConsentFailure(createZeniAPIStatus(networkErrorMessage)),
57
61
  failureSnackbar(networkErrorMessage),