Skip to content

Commit b72867f

Browse files
committed
Show only the latest errors under saml enabled and required switches
1 parent a4c6ae2 commit b72867f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/pages/domain/Saml/SamlLoginSectionContent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import useLocalize from '@hooks/useLocalize';
77
import useOnyx from '@hooks/useOnyx';
88
import useThemeStyles from '@hooks/useThemeStyles';
99
import {resetSamlEnabledError, resetSamlRequiredError, setSamlEnabled, setSamlRequired} from '@libs/actions/Domain';
10+
import {getLatestErrorMessageField} from '@libs/ErrorUtils';
1011
import CONST from '@src/CONST';
1112
import ONYXKEYS from '@src/ONYXKEYS';
1213
import {domainSamlSettingsStateSelector} from '@src/selectors/Domain';
@@ -38,7 +39,7 @@ function SamlLoginSectionContent({accountID, domainName, isSamlEnabled, isSamlRe
3839
<>
3940
<OfflineWithFeedback
4041
pendingAction={domain?.isSamlEnabledLoading ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : undefined}
41-
errors={domain?.samlEnabledError}
42+
errors={getLatestErrorMessageField({errors: domain?.samlEnabledError})}
4243
onClose={() => resetSamlEnabledError(accountID)}
4344
dismissError={() => resetSamlEnabledError(accountID)}
4445
>
@@ -60,7 +61,7 @@ function SamlLoginSectionContent({accountID, domainName, isSamlEnabled, isSamlRe
6061
{isSamlEnabled && (
6162
<OfflineWithFeedback
6263
pendingAction={domain?.isSamlRequiredLoading ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : undefined}
63-
errors={domain?.samlRequiredError}
64+
errors={getLatestErrorMessageField({errors: domain?.samlRequiredError})}
6465
onClose={() => resetSamlRequiredError(accountID)}
6566
dismissError={() => resetSamlRequiredError(accountID)}
6667
>

0 commit comments

Comments
 (0)