Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix: include bonus in storage quota check (#1483)

Neeraj Guptacd7ee6bf4b7c
diff --git a/apps/photos/src/utils/billing/index.ts b/apps/photos/src/utils/billing/index.ts
index 056fe66121..4e62a5d770 100644
--- a/apps/photos/src/utils/billing/index.ts
+++ b/apps/photos/src/utils/billing/index.ts
@@ -140,11 +140,12 @@ export function hasMobileSubscription(subscription: Subscription) {
}
export function hasExceededStorageQuota(userDetails: UserDetails) {
+ const bonusStorage = userDetails.storageBonus ?? 0;
if (isPartOfFamily(userDetails.familyData)) {
const usage = getTotalFamilyUsage(userDetails.familyData);
- return usage > userDetails.familyData.storage;
+ return usage > (userDetails.familyData.storage + bonusStorage);
} else {
- return userDetails.usage > userDetails.subscription.storage;
+ return userDetails.usage > (userDetails.subscription.storage + bonusStorage);
}
}