Skip to content

Commit df8a23a

Browse files
committed
Add isDebug
1 parent 0f574bf commit df8a23a

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/billing/cloudpayments.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,16 @@ export default class CloudPaymentsWebhooks {
180180
*/
181181
private isPlanExpired(workspace: WorkspaceModel): boolean {
182182
const lastChargeDate = new Date(workspace.lastChargeDate);
183-
const planExpiracyDate = lastChargeDate.setMonth(lastChargeDate.getMonth() + 1);
183+
184+
let planExpiracyDate;
185+
186+
if (workspace.isDebug) {
187+
planExpiracyDate = lastChargeDate.setDate(lastChargeDate.getDate() + 1);
188+
} else {
189+
planExpiracyDate = lastChargeDate.setMonth(lastChargeDate.getMonth() + 1);
190+
191+
}
192+
184193
const isPlanExpired = planExpiracyDate < Date.now();
185194

186195
return isPlanExpired;

0 commit comments

Comments
 (0)