Skip to content

Commit

Permalink
Clear OAuth error onCancel.
Browse files Browse the repository at this point in the history
  • Loading branch information
hussain-t committed Jul 3, 2024
1 parent 77fff95 commit 6adc446
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,16 @@ function AudienceSegmentationSetupCTAWidget( { Widget, WidgetNull } ) {
};

const { clearPermissionScopeError } = useDispatch( CORE_USER );
const { setSetupErrorCode } = useDispatch( CORE_SITE );

const onCancel = useCallback( () => {
clearPermissionScopeError();
setShowErrorModal( false );
setValues( AUDIENCE_SEGMENTATION_SETUP_FORM, {
autoSubmit: false,
} );
}, [ clearPermissionScopeError, setValues ] );
clearPermissionScopeError();
setSetupErrorCode( null );
setShowErrorModal( false );
}, [ clearPermissionScopeError, setSetupErrorCode, setValues ] );

const setupErrorCode = useSelect( ( select ) =>
select( CORE_SITE ).getSetupErrorCode()
Expand Down

0 comments on commit 6adc446

Please sign in to comment.