Skip to content

Commit c012cfd

Browse files
author
Myztiq
committed
Updated logic to only show badge when in last 3 days.
1 parent 0699efd commit c012cfd

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

client/directives/accountsSelect/directiveAccountsSelect.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ function accountsSelect (
105105
return '';
106106
}
107107
if (currentOrg.poppa.isInTrial() && !currentOrg.poppa.attrs.hasPaymentMethod) {
108-
return currentOrg.poppa.trialDaysRemaining();
108+
var trialRemaining = currentOrg.poppa.trialDaysRemaining();
109+
if (trialRemaining <= 3) {
110+
return trialRemaining;
111+
}
109112
}
110113
return '';
111114
};
@@ -114,9 +117,10 @@ function accountsSelect (
114117
if (!$rootScope.featureFlags.billing) {
115118
return {};
116119
}
120+
var showBadge = currentOrg.poppa.isInTrial() && !currentOrg.poppa.attrs.hasPaymentMethod && currentOrg.poppa.trialDaysRemaining() <= 3;
117121
return {
118-
badge: currentOrg.poppa.isInTrial() && !currentOrg.poppa.attrs.hasPaymentMethod,
119-
'badge-orange': currentOrg.poppa.isInTrial() && !currentOrg.poppa.attrs.hasPaymentMethod
122+
badge: showBadge,
123+
'badge-orange': showBadge
120124
};
121125
};
122126
}

0 commit comments

Comments
 (0)