Merge pull request #1027 from automatisch/hide-invoices-when-empty
fix: hide empty invoices section
This commit is contained in:
@@ -7,6 +7,11 @@ const getInvoices = async (
|
||||
context: Context
|
||||
) => {
|
||||
const subscription = await context.currentUser.$relatedQuery('subscription');
|
||||
|
||||
if (!subscription) {
|
||||
return;
|
||||
}
|
||||
|
||||
const invoices = await Billing.paddleClient.getInvoices(
|
||||
Number(subscription.paddleSubscriptionId)
|
||||
);
|
||||
|
@@ -13,7 +13,9 @@ import useFormatMessage from 'hooks/useFormatMessage';
|
||||
|
||||
export default function Invoices() {
|
||||
const formatMessage = useFormatMessage();
|
||||
const { invoices } = useInvoices();
|
||||
const { invoices, loading } = useInvoices();
|
||||
|
||||
if (loading || invoices.length === 0) return <React.Fragment />;
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
Reference in New Issue
Block a user