Skip to content

Commit

Permalink
deprecation handling
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelsc committed Jun 5, 2024
1 parent dcb85e7 commit ebc245c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/subscribe/subscribe.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class SubscribePage implements OnInit {
private flavor: FlavorUtils,
private api: ApiService
) {
this.selectedPackage = this.merchant.PACKAGES[2]
this.selectedPackage = this.merchant.PACKAGES[1]
}

ngOnInit() {
Expand Down
38 changes: 24 additions & 14 deletions src/app/utils/MerchantUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,23 @@ const MAX_PRODUCT = 'whale'
providedIn: 'root',
})
export class MerchantUtils {
DEPRECATED_PACKAGES = [
{
name: 'Plankton',
price: '$1.99',
maxValidators: 100,
maxTestnetValidators: 100,
maxBeaconNodes: 1,
deviceMonitoringHours: 30 * 24,
deviceMonitorAlerts: true,
noAds: true,
widgets: false,
customTheme: false,
supportUs: true,
purchaseKey: 'plankton',
},
]

PACKAGES: Package[] = [
{
name: 'Free',
Expand All @@ -50,20 +67,6 @@ export class MerchantUtils {
supportUs: false,
purchaseKey: null,
},
// {
// name: 'Plankton',
// price: '$1.99',
// maxValidators: 100,
// maxTestnetValidators: 100,
// maxBeaconNodes: 1,
// deviceMonitoringHours: 30 * 24,
// deviceMonitorAlerts: true,
// noAds: true,
// widgets: false,
// customTheme: false,
// supportUs: true,
// purchaseKey: 'plankton',
// },
{
name: 'Goldfish',
price: '$4.99',
Expand Down Expand Up @@ -367,6 +370,13 @@ export class MerchantUtils {
return current
}
}
for (let i = 0; i < this.DEPRECATED_PACKAGES.length; i++) {
const current = this.DEPRECATED_PACKAGES[i]
if (current.purchaseKey == name) {
return current
}
}

return null
}

Expand Down

0 comments on commit ebc245c

Please sign in to comment.