don't block, use suspense

This commit is contained in:
Paul Miller
2023-04-06 16:01:30 -05:00
parent 4d2b99d621
commit 6ca4dee75d
2 changed files with 8 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ export default function App() {
<header class='text-sm font-semibold uppercase'>
Activity
</header>
<For each={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}>
<For each={[1, 2, 3, 4]}>
{() =>
<Presence>
<Motion

View File

@@ -1,6 +1,6 @@
import { Motion, Presence } from "@motionone/solid";
import { MutinyBalance } from "@mutinywallet/node-manager";
import { createResource, Show } from "solid-js";
import { createResource, Show, Suspense } from "solid-js";
import { useNodeManager } from "~/state/nodeManagerState";
import { ButtonLink } from "./Button";
@@ -42,10 +42,12 @@ export default function BalanceBox() {
</header>
<div onClick={refetchBalance}>
<h1 class='text-4xl font-light'>
<Show when={balance()}>
{/* TODO: no-non-null-asssertion but type narrowing just isn't working */}
{prettyPrintBalance(balance()!)} <span class='text-xl'>SAT</span>
</Show>
<Suspense fallback={"..."}>
<Show when={balance()}>
{/* TODO: no-non-null-asssertion but type narrowing just isn't working */}
{prettyPrintBalance(balance()!)} <span class='text-xl'>SAT</span>
</Show>
</Suspense>
</h1>
</div>
<div class="flex gap-2 py-4">