diff --git a/src/App.tsx b/src/App.tsx index a4a3aac..47e0711 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -10,8 +10,6 @@ import { DialogContent, } from "@mui/material" -// TODO: Improve error-handling. Introduce some proper server response. - type Result = { tag: "ok"; value: A } | { tag: "error"; error: E } const Result = { @@ -141,7 +139,6 @@ async function fetchJsonSafeWith( case "error": return Result.err(result.error) case "ok": - // TODO try { return Result.ok(f(result.value)) } catch (error: unknown) { @@ -201,7 +198,6 @@ function getImageSource(id: ImageId, dimension: Dimension): ImageRef { } // === App === -// TODO: introduce proper error type type AppError = RequestError type State = { @@ -255,7 +251,6 @@ function useApp(): [State, Dispatch] { // === initialization & reloading === useEffect(() => { - // TODO: error-handling void getImageIdsCached(state.page).then((result) => { dispatch({ tag: "imagesReceived", forPage: state.page, result }) }) @@ -270,8 +265,6 @@ function useApp(): [State, Dispatch] { return state } case "retryButtonClicked": - console.log("TODO") - // TODO: This actually needs to trigger the reload somehow /facepalm. But we can refresh only on page change. return { ...state, imageIds: Remote.loading(), refreshSignal: !state.refreshSignal } case "previousButtonClicked": { const newPage = Page.previous(state.page)