summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrank <[email protected]>2025-11-08 10:33:54 -0500
committerFrank <[email protected]>2025-11-08 10:33:56 -0500
commitf8a1a0b26fee9afbc9c66d5a1c95336486b3a6ed (patch)
tree6387073b2a31dec0e064bdd43331626e45c4c15c
parent6ecaf83f76cf5a7c87dc118c01303f18aac35419 (diff)
downloadopencode-f8a1a0b26fee9afbc9c66d5a1c95336486b3a6ed.tar.gz
opencode-f8a1a0b26fee9afbc9c66d5a1c95336486b3a6ed.zip
zen: fix billing button
-rw-r--r--packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx b/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx
index 05f8edd01..fe4e08b7c 100644
--- a/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx
+++ b/packages/console/app/src/routes/workspace/[id]/billing/billing-section.tsx
@@ -34,10 +34,17 @@ export function BillingSection() {
const sessionSubmission = useSubmission(createSessionUrl)
const [store, setStore] = createStore({
showAddBalanceForm: false,
- addBalanceAmount: "",
+ addBalanceAmount: billingInfo()?.reloadAmount.toString() ?? "",
checkoutRedirecting: false,
sessionRedirecting: false,
})
+
+ createEffect(() => {
+ const info = billingInfo()
+ if (info) {
+ setStore("addBalanceAmount", info.reloadAmount.toString())
+ }
+ })
const balance = createMemo(() => formatBalance(billingInfo()?.balance ?? 0))
async function onClickCheckout() {
@@ -67,7 +74,6 @@ export function BillingSection() {
}
setStore({
showAddBalanceForm: true,
- addBalanceAmount: billingInfo()!.reloadAmount.toString(),
})
}