mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-05 23:34:26 +01:00
fix #55 js exception
This commit is contained in:
@@ -19,7 +19,7 @@ type OnChainTx = {
|
||||
sent: number
|
||||
fee?: number
|
||||
confirmation_time?: {
|
||||
"Confirmed": {
|
||||
"Confirmed"?: {
|
||||
height: number
|
||||
time: number
|
||||
}
|
||||
@@ -63,7 +63,7 @@ function OnChainItem(props: { item: OnChainTx }) {
|
||||
<SmallHeader class={isReceive() ? "text-m-green" : "text-m-red"}>
|
||||
{isReceive() ? "RECEIVE" : "SEND"}
|
||||
</SmallHeader>
|
||||
<SubtleText>{props.item.confirmation_time ? prettyPrintTime(props.item.confirmation_time.Confirmed.time) : "Unconfirmed"}</SubtleText>
|
||||
<SubtleText>{props.item.confirmation_time?.Confirmed ? prettyPrintTime(props.item.confirmation_time?.Confirmed?.time) : "Unconfirmed"}</SubtleText>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
||||
20
src/components/ErrorDisplay.tsx
Normal file
20
src/components/ErrorDisplay.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Title } from "solid-start";
|
||||
import { ButtonLink, DefaultMain, LargeHeader, SafeArea, SmallHeader } from "~/components/layout";
|
||||
|
||||
export default function ErrorDisplay(props: { error: Error }) {
|
||||
return (
|
||||
<SafeArea>
|
||||
<Title>Oh no!</Title>
|
||||
<DefaultMain>
|
||||
<LargeHeader>Error</LargeHeader>
|
||||
<SmallHeader>This never should've happened</SmallHeader>
|
||||
<p class="bg-white/10 rounded-xl p-4 font-mono">
|
||||
<span class="font-bold">
|
||||
{props.error.name}</span>: {props.error.message}
|
||||
</p>
|
||||
<div class="h-full" />
|
||||
<ButtonLink href="/" intent="red">Dangit</ButtonLink>
|
||||
</DefaultMain>
|
||||
</SafeArea>
|
||||
);
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
import "./root.css";
|
||||
import { Provider as MegaStoreProvider } from "~/state/megaStore";
|
||||
import { Toaster } from "~/components/Toaster";
|
||||
import ErrorDisplay from "./components/ErrorDisplay";
|
||||
|
||||
export default function Root() {
|
||||
return (
|
||||
@@ -35,7 +36,7 @@ export default function Root() {
|
||||
</Head>
|
||||
<Body>
|
||||
<Suspense>
|
||||
<ErrorBoundary>
|
||||
<ErrorBoundary fallback={(e) => <ErrorDisplay error={e} />}>
|
||||
<MegaStoreProvider>
|
||||
<Routes>
|
||||
<FileRoutes />
|
||||
|
||||
@@ -5,7 +5,6 @@ import { ButtonLink, DefaultMain, LargeHeader, SafeArea } from "~/components/lay
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<SafeArea>
|
||||
|
||||
<Title>Not Found</Title>
|
||||
<HttpStatusCode code={404} />
|
||||
<DefaultMain>
|
||||
|
||||
Reference in New Issue
Block a user