diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-03 13:37:27 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-03 14:56:30 -0300 |
commit | 4bf1ab8ba924b2a0fc4813814bdeeb66a2928382 (patch) | |
tree | 8052cd83d9935db2c054a58f7d231c528b8dfc0d /packages/merchant-backoffice-ui/src/paths/instance/token | |
parent | 56da180423029a1b53d2be343eed4f073e96dc89 (diff) | |
download | wallet-core-4bf1ab8ba924b2a0fc4813814bdeeb66a2928382.tar.xz |
wip #8655: fixing broken build
Diffstat (limited to 'packages/merchant-backoffice-ui/src/paths/instance/token')
-rw-r--r-- | packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx index 16a4bda22..444283b13 100644 --- a/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx +++ b/packages/merchant-backoffice-ui/src/paths/instance/token/index.tsx @@ -13,38 +13,31 @@ You should have received a copy of the GNU General Public License along with GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ -import { HttpStatusCode, TalerError, TalerErrorDetail } from "@gnu-taler/taler-util"; -import { ErrorType, HttpError, useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; +import { TalerError } from "@gnu-taler/taler-util"; +import { useMerchantApiContext, useTranslationContext } from "@gnu-taler/web-util/browser"; import { Fragment, VNode, h } from "preact"; import { useState } from "preact/hooks"; +import { ErrorLoadingMerchant } from "../../../components/ErrorLoadingMerchant.js"; import { Loading } from "../../../components/exception/loading.js"; import { NotificationCard } from "../../../components/menu/index.js"; import { useSessionContext } from "../../../context/session.js"; import { useInstanceDetails } from "../../../hooks/instance.js"; import { Notification } from "../../../utils/types.js"; import { DetailPage } from "./DetailPage.js"; -import { ErrorLoadingMerchant } from "../../../components/ErrorLoadingMerchant.js"; interface Props { - onUnauthorized: () => VNode; - onLoadError: (error: HttpError<TalerErrorDetail>) => VNode; onChange: () => void; - onNotFound: () => VNode; onCancel: () => void; } export default function Token({ - onLoadError, onChange, - onUnauthorized, - onNotFound, onCancel, }: Props): VNode { const { i18n } = useTranslationContext(); const { lib } = useMerchantApiContext(); const { logIn } = useSessionContext(); const [notif, setNotif] = useState<Notification | undefined>(undefined); - // const { clearAccessToken } = useInstanceAPI(); const result = useInstanceDetails() if (!result) return <Loading /> @@ -52,21 +45,6 @@ export default function Token({ return <ErrorLoadingMerchant error={result} /> } - // if (result.loading) return <Loading />; - // if (!result.ok) { - // if ( - // result.type === ErrorType.CLIENT && - // result.status === HttpStatusCode.Unauthorized - // ) - // return onUnauthorized(); - // if ( - // result.type === ErrorType.CLIENT && - // result.status === HttpStatusCode.NotFound - // ) - // return onNotFound(); - // return onLoadError(result); - // } - const hasToken = result.body.auth.method === "token" return ( |