update jambonz cloud free plan subscription (#379)

This commit is contained in:
Hoan Luu Huu
2024-01-12 21:24:10 +07:00
committed by GitHub
parent 8b9c7ca9c0
commit 6ddcb82adc
2 changed files with 11 additions and 4 deletions
+1
View File
@@ -262,6 +262,7 @@ export interface Account {
plan_type?: string;
device_to_call_ratio?: number;
trial_end_date?: null | string;
is_active: boolean;
}
export interface Product {
@@ -579,7 +579,7 @@ export const AccountForm = ({
(userData.account.device_to_call_ratio || 0) *
(callSessionRecord.quantity || 0) +
(registeredDeviceRecord.quantity || 0);
const { trial_end_date } = userData.account || {};
const { trial_end_date, is_active } = userData.account || {};
switch (pType) {
case PlanType.TRIAL:
setSubscriptionDescription(
@@ -609,9 +609,15 @@ export const AccountForm = ({
break;
case PlanType.FREE:
setSubscriptionDescription(
`You are currently on the Free plan (trial period expired). You are limited to ${callSessionRecord.quantity} simultaneous calls and ${quantity} registered devices`
);
if (is_active) {
setSubscriptionDescription(
`You are currently on the Free plan (trial period expired). You are limited to ${callSessionRecord.quantity} simultaneous calls and ${quantity} registered devices`
);
} else {
setSubscriptionDescription(
"Your free trial has expired. Please upgrade your subscription to a paid plan to continue service"
);
}
break;
}
// Make sure Account page is alway scroll to top to see subscription