FIx installed list filter

This commit is contained in:
Bero 2023-09-28 20:58:07 +02:00
parent 2f7e57fb5b
commit 60ef6dbbaf
1 changed files with 4 additions and 6 deletions

View File

@ -87,11 +87,7 @@ export default function MySubscriptions(): JSX.Element {
}, },
]; ];
const subscriptionsInstalled: Array< Subscription > = subscriptions.filter( const subscriptionsInstalled: Array< Subscription > = subscriptions.filter(
( subscription: Subscription ) => ( subscription: Subscription ) => subscription.local.installed
subscription.local.active &&
( subscription.active ||
subscription.product_key === '' ||
subscription.expired )
); );
const tableHeadersAvailable = [ const tableHeadersAvailable = [
@ -136,8 +132,10 @@ export default function MySubscriptions(): JSX.Element {
return __( 'Not found', 'woocommerce' ); return __( 'Not found', 'woocommerce' );
} else if ( subscription.expired ) { } else if ( subscription.expired ) {
return __( 'Expired', 'woocommerce' ); return __( 'Expired', 'woocommerce' );
} else if ( subscription.active ) {
return __( 'Active', 'woocommerce' );
} }
return __( 'Active', 'woocommerce' ); return __( 'Inactive', 'woocommerce' );
}; };
const getVersion = ( subscription: Subscription ): string => { const getVersion = ( subscription: Subscription ): string => {