Cleanup TODOs
This commit is contained in:
parent
65fd45fc16
commit
5f9bdd5511
1 changed files with 0 additions and 7 deletions
|
|
@ -10,8 +10,6 @@ import {
|
||||||
DialogContent,
|
DialogContent,
|
||||||
} from "@mui/material"
|
} from "@mui/material"
|
||||||
|
|
||||||
// TODO: Improve error-handling. Introduce some proper server response.
|
|
||||||
|
|
||||||
type Result<A, E> = { tag: "ok"; value: A } | { tag: "error"; error: E }
|
type Result<A, E> = { tag: "ok"; value: A } | { tag: "error"; error: E }
|
||||||
|
|
||||||
const Result = {
|
const Result = {
|
||||||
|
|
@ -141,7 +139,6 @@ async function fetchJsonSafeWith<A>(
|
||||||
case "error":
|
case "error":
|
||||||
return Result.err(result.error)
|
return Result.err(result.error)
|
||||||
case "ok":
|
case "ok":
|
||||||
// TODO
|
|
||||||
try {
|
try {
|
||||||
return Result.ok(f(result.value))
|
return Result.ok(f(result.value))
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
|
|
@ -201,7 +198,6 @@ function getImageSource(id: ImageId, dimension: Dimension): ImageRef {
|
||||||
}
|
}
|
||||||
|
|
||||||
// === App ===
|
// === App ===
|
||||||
// TODO: introduce proper error type
|
|
||||||
type AppError = RequestError
|
type AppError = RequestError
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
|
|
@ -255,7 +251,6 @@ function useApp(): [State, Dispatch] {
|
||||||
|
|
||||||
// === initialization & reloading ===
|
// === initialization & reloading ===
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// TODO: error-handling
|
|
||||||
void getImageIdsCached(state.page).then((result) => {
|
void getImageIdsCached(state.page).then((result) => {
|
||||||
dispatch({ tag: "imagesReceived", forPage: state.page, result })
|
dispatch({ tag: "imagesReceived", forPage: state.page, result })
|
||||||
})
|
})
|
||||||
|
|
@ -270,8 +265,6 @@ function useApp(): [State, Dispatch] {
|
||||||
return state
|
return state
|
||||||
}
|
}
|
||||||
case "retryButtonClicked":
|
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 }
|
return { ...state, imageIds: Remote.loading(), refreshSignal: !state.refreshSignal }
|
||||||
case "previousButtonClicked": {
|
case "previousButtonClicked": {
|
||||||
const newPage = Page.previous(state.page)
|
const newPage = Page.previous(state.page)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue