From 694ce60e2c6e37f1aa98962b9a99ad75373e9fbd Mon Sep 17 00:00:00 2001 From: benguedj <71835422+benguedj@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:08:50 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Permet=20de=20masquer=20l?= =?UTF-8?q?es=20messages=20d'erreur=20graphQL=20(#1429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/components/app/checkAppVersion.component.tsx | 1 + front/src/services/graphQL/graphQLQueries.component.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/front/src/components/app/checkAppVersion.component.tsx b/front/src/components/app/checkAppVersion.component.tsx index 32a70a18a..872e47677 100644 --- a/front/src/components/app/checkAppVersion.component.tsx +++ b/front/src/components/app/checkAppVersion.component.tsx @@ -53,6 +53,7 @@ const CheckAppVersion: FC = () => { query={ConfigQueries.CONFIG_GET_LAST_APP_VERSION} fetchPolicy={FetchPoliciesConstants.NO_CACHE} getFetchedData={handleResults} + showErrorMessage={false} /> ); }; diff --git a/front/src/services/graphQL/graphQLQueries.component.tsx b/front/src/services/graphQL/graphQLQueries.component.tsx index afe527137..a82533524 100644 --- a/front/src/services/graphQL/graphQLQueries.component.tsx +++ b/front/src/services/graphQL/graphQLQueries.component.tsx @@ -14,6 +14,7 @@ interface Props { notifyOnNetworkStatusChange?: boolean; noLoader?: boolean; noLoaderBackdrop?: boolean; + showErrorMessage?: boolean; } export const GraphQLQuery: FC = ({ @@ -23,6 +24,7 @@ export const GraphQLQuery: FC = ({ notifyOnNetworkStatusChange, noLoader, noLoaderBackdrop, + showErrorMessage = true, }) => { const { loading, error, data } = useQuery(gql(query), { fetchPolicy: fetchPolicy ?? FetchPoliciesConstants.NETWORK_ONLY, @@ -36,7 +38,7 @@ export const GraphQLQuery: FC = ({ return ( ); - if (error) return ; + if (error && showErrorMessage) return ; return null; };