From 4a9a8143147ba8a49dac3cf8bb228db3d52bd902 Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Tue, 4 Jun 2024 21:13:51 +0530 Subject: [PATCH] Improve Error Handling for FacebookConnectButton --- src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js b/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js index 1abae0717..c9e7a627f 100644 --- a/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js +++ b/src/OnboardingSPA/steps/SiteGen/SocialMedia/index.js @@ -78,7 +78,11 @@ const SiteGenSiteSocialMedia = () => { setConnected( true ); }; - const handleFailure = () => { + const handleFailure = ( error ) => { + // This happens when a call is made to retrieve the facebook details when the button first renders. + if ( 404 === error?.data?.status ) { + return; + } updateSiteGenErrorStatus( true ); };