We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f574bf commit df8a23aCopy full SHA for df8a23a
1 file changed
src/billing/cloudpayments.ts
@@ -180,7 +180,16 @@ export default class CloudPaymentsWebhooks {
180
*/
181
private isPlanExpired(workspace: WorkspaceModel): boolean {
182
const lastChargeDate = new Date(workspace.lastChargeDate);
183
- const planExpiracyDate = lastChargeDate.setMonth(lastChargeDate.getMonth() + 1);
+
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
193
const isPlanExpired = planExpiracyDate < Date.now();
194
195
return isPlanExpired;
0 commit comments