Hide OpenCredits option when feature flag is disabled and bump to 2.0.5

Only show "Just try it · Pay as you go with OpenCredits" in the
install modal when the OpenCredits feature flag is enabled for
the user's region.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
andrepimenta
2026-04-19 21:21:11 +01:00
parent 474910a330
commit 3d8bcf5241
4 changed files with 11 additions and 3 deletions

View File

@@ -2839,6 +2839,10 @@ const getScript = (isTelemetryEnabled: boolean, opencreditsApiUrl: string = 'htt
if (checkout) checkout.style.display = 'none';
if (funds) funds.style.display = 'none';
// Hide OpenCredits option if feature flag is disabled
var ocOption = document.getElementById('installOpenCreditsOption');
if (ocOption) ocOption.style.display = opencreditsEnabled ? '' : 'none';
sendStats('Login options shown');
}
@@ -2872,6 +2876,10 @@ const getScript = (isTelemetryEnabled: boolean, opencreditsApiUrl: string = 'htt
const successEl = document.getElementById('installSuccess');
successEl.style.display = 'flex';
// Hide OpenCredits option if feature flag is disabled
const ocOption = document.getElementById('installOpenCreditsOption');
if (ocOption) ocOption.style.display = opencreditsEnabled ? '' : 'none';
if (success) {
sendStats('Install success');
successEl.querySelector('.install-success-text').textContent = 'Installed';