Skip to content

Commit

Permalink
fix: update logic to show subsidy cards
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinan029 committed Sep 25, 2024
1 parent 28257fe commit 3cb9f2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const CustomerPlanContainer = ({
}) => {
const [showInactive, setShowInactive] = useState(false);
const countOfActivePlans = activeSubscriptions.length + activeSubsidies.length;
const countOfInactivePlans = inactiveSubscriptions.length + activeSubsidies.length;
const countOfInactivePlans = inactiveSubscriptions.length + inactiveSubsidies.length;
const countOfAllPlans = countOfActivePlans + countOfInactivePlans;
useEffect(() => {
if (!countOfActivePlans && countOfAllPlans) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ const CustomerViewContainer = () => {
}, [fetchData]);

const renderPlanContainer = () => {
if (!isLoading && !associatedPlans.isLoading && associatedPlans.countOfAllPlans) {
if (!isLoading && !associatedPlans.isLoading && (associatedPlans.activeSubsidies.length > 0 || associatedPlans.activeSubscriptions.length > 0)) {

Check failure on line 44 in src/Configuration/Customers/CustomerDetailView/CustomerViewContainer.jsx

View workflow job for this annotation

GitHub Actions / tests (20)

This line has a length of 149. Maximum allowed is 120
return (
<Stack gap={2}>
<CustomerPlanContainer slug={enterpriseCustomer.slug} {...associatedPlans} />
</Stack>
);
}
if (!associatedPlans.isLoading && !associatedPlans.countOfAllPlans) {
if (!associatedPlans.isLoading && (!associatedPlans.activeSubsidies.length || !associatedPlans.activeSubscriptions.length)) {

Check failure on line 51 in src/Configuration/Customers/CustomerDetailView/CustomerViewContainer.jsx

View workflow job for this annotation

GitHub Actions / tests (20)

This line has a length of 129. Maximum allowed is 120
return false;
}
if (associatedPlans.isLoading) {
Expand Down

0 comments on commit 3cb9f2b

Please sign in to comment.