From c8f89be2cf6c52e9711707eb149fc529d84c7ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Gr=C3=BCneberg?= Date: Tue, 18 Jul 2023 14:01:37 +0200 Subject: [PATCH] fix: loading invoices on hard reload --- studio/components/interfaces/BillingV2/Invoices.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/studio/components/interfaces/BillingV2/Invoices.tsx b/studio/components/interfaces/BillingV2/Invoices.tsx index 7e76d49d5e5..74c40ec8971 100644 --- a/studio/components/interfaces/BillingV2/Invoices.tsx +++ b/studio/components/interfaces/BillingV2/Invoices.tsx @@ -27,6 +27,8 @@ const Invoices: FC = ({ projectRef }) => { const offset = (page - 1) * PAGE_LIMIT useEffect(() => { + if (!projectRef) return + let cancel = false const page = 1 @@ -48,7 +50,7 @@ const Invoices: FC = ({ projectRef }) => { return () => { cancel = true } - }, []) + }, [projectRef]) const fetchInvoices = async (page: number) => { setLoading(true)