diff options
Diffstat (limited to 'packages/demobank-ui/src/pages/PublicHistoriesPage.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/PublicHistoriesPage.tsx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx b/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx index 2b5f7e26c..290fd0a79 100644 --- a/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx +++ b/packages/demobank-ui/src/pages/PublicHistoriesPage.tsx @@ -24,6 +24,13 @@ import { Fragment, h, VNode } from "preact"; import { StateUpdater } from "preact/hooks"; import { Transactions } from "../components/Transactions/index.js"; import { usePublicAccounts } from "../hooks/access.js"; +import { + PageStateType, + notifyError, + usePageContext, +} from "../context/pageState.js"; +import { handleNotOkResult } from "./HomePage.js"; +import { Loading } from "../components/Loading.js"; const logger = new Logger("PublicHistoriesPage"); @@ -36,9 +43,7 @@ const logger = new Logger("PublicHistoriesPage"); // } interface Props { - onLoadNotOk: <T>( - error: HttpResponsePaginated<T, SandboxBackend.SandboxError>, - ) => VNode; + onLoadNotOk: () => void; } /** @@ -49,7 +54,10 @@ export function PublicHistoriesPage({ onLoadNotOk }: Props): VNode { const { i18n } = useTranslationContext(); const result = usePublicAccounts(); - if (!result.ok) return onLoadNotOk(result); + if (!result.ok) { + onLoadNotOk(); + return handleNotOkResult(i18n)(result); + } const { data } = result; |