From cf3ad82a7211e870bb6c49b34b0fd1a1e7830b15 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Tue, 8 Nov 2022 16:45:43 +0100 Subject: [PATCH] Enabled donations on Google Play --- src/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8123ce7..2dadb5a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -117,11 +117,15 @@ export async function handleRequest(request: Request) { servers: servers, }; + // Disable donates for Google reviewers for all google app versions AFTER this one. + const lastApprovedAndReleasedGoogleAppVersionCode = 221102; let donatesEnabled = true; - if (appVersion.flavor == 'google') { - // Disable donates for Google reviewers. - if ((request.cf?.asOrganization || '').toLowerCase().includes('google') || appVersion.code == 221102) - donatesEnabled = false; + if ( + appVersion.flavor === 'google' && + ((request.cf?.asOrganization || '').toLowerCase().includes('google') || + appVersion.code > lastApprovedAndReleasedGoogleAppVersionCode) + ) { + donatesEnabled = false; } if (donatesEnabled) {