diff --git a/app/demos/account/AccountDemo.tsx b/app/demos/account/AccountDemo.tsx index 5a9988b..054aacb 100644 --- a/app/demos/account/AccountDemo.tsx +++ b/app/demos/account/AccountDemo.tsx @@ -975,12 +975,22 @@ export function AccountDemo() { ]); const ethBefore = BigInt(assetBals.vibenet?.eth_wei ?? '0'); const deadline = Date.now() + 8_000; + let credited = false; while (Date.now() < deadline) { await new Promise((r) => setTimeout(r, 500)); const fresh = await refreshVibenetBalances(); - if (BigInt(fresh?.eth_wei ?? '0') > ethBefore) break; + if (BigInt(fresh?.eth_wei ?? '0') > ethBefore) { + credited = true; + break; + } + } + if (credited) { + toast.success('Topped up successfully'); + } else { + toast.error( + "Top up didn't go through — Vibenet may be down for maintenance. Please try again shortly.", + ); } - toast.success('Topped up successfully'); } catch (e) { setError((e as Error).message); toast.error('Top up failed'); @@ -2925,7 +2935,7 @@ export function AccountDemo() {
-
+