Преглед на файлове

Refetch payment enabled after adding payment method on home

Mauricio Araujo преди 2 години
родител
ревизия
14b89784e0
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      dashboard/src/main/home/Home.tsx

+ 4 - 2
dashboard/src/main/home/Home.tsx

@@ -215,7 +215,7 @@ const Home: React.FC<Props> = (props) => {
       } else {
         setHasFinishedOnboarding(true);
       }
-    } catch (error) {}
+    } catch (error) { }
   };
 
   useEffect(() => {
@@ -369,7 +369,7 @@ const Home: React.FC<Props> = (props) => {
   };
 
   const { cluster, baseRoute } = props.match.params as any;
-  const { hasPaymentEnabled } = checkIfProjectHasPayment();
+  const { hasPaymentEnabled, refetchPaymentEnabled } = checkIfProjectHasPayment();
   const { plan } = useCustomerPlan();
 
   const isTrialExpired = (timestamp: string): boolean => {
@@ -426,6 +426,7 @@ const Home: React.FC<Props> = (props) => {
                     setShowBillingModal(false);
                   }}
                   onCreate={async () => {
+                    await refetchPaymentEnabled({ throwOnError: false, cancelRefetch: false });
                     setShowBillingModal(false);
                   }}
                 />
@@ -434,6 +435,7 @@ const Home: React.FC<Props> = (props) => {
                 <BillingModal
                   trialExpired
                   onCreate={async () => {
+                    await refetchPaymentEnabled({ throwOnError: false, cancelRefetch: false });
                     setShowBillingModal(false);
                   }}
                 />