Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(pricing): decouple standalone upgrade button from pricing card loading state

Gabriel Stein39c19f21ccac
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 11fad177d..30c54c311 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -2092,14 +2092,26 @@ export default function SettingsPage({
</Button>
) : (
<Button
- onClick={() =>
- handleCheckout(billingState.pro ? "annual" : "monthly", "pro")
- }
+ onClick={async () => {
+ const result = await usage.openCheckout({
+ plan: billingState.pro ? "annual" : "monthly",
+ tier: "pro",
+ });
+ if (!result.success) {
+ toast({
+ title: t("settingsPage.account.checkout.couldNotOpenTitle"),
+ description: t(
+ "settingsPage.account.checkout.couldNotOpenDescription"
+ ),
+ variant: "destructive",
+ });
+ }
+ }}
size="sm"
className="w-full"
- disabled={checkoutTier === "pro"}
+ disabled={usage.checkoutLoading}
>
- {checkoutTier === "pro"
+ {usage.checkoutLoading
? t("settingsPage.account.checkout.opening")
: t("settingsPage.account.checkout.upgradeToPro")}
</Button>