Download REST API endpoints (#72)

* backend and frontend hotfixes, see message

Improved rendering on the frontend by cutting unecessary useStates.
Backend side, downloads now auto resume even on application kill.

* download rest api endpoints, general code refactor

* download request json mappings
This commit is contained in:
Marco
2023-07-31 08:30:09 +02:00
committed by GitHub
parent 68c829c40e
commit 8327d1e94c
22 changed files with 560 additions and 300 deletions

View File

@@ -0,0 +1,23 @@
import { Alert, Snackbar } from "@mui/material"
import { useDispatch, useSelector } from "react-redux"
import { setClose } from "../features/ui/toastSlice"
import { RootState } from "../stores/store"
const Toaster: React.FC = () => {
const toast = useSelector((state: RootState) => state.toast)
const dispatch = useDispatch()
return (
<Snackbar
open={toast.open}
autoHideDuration={toast.severity === 'error' ? 10000 : 1500}
onClose={() => dispatch(setClose())}
>
<Alert variant="filled" severity={toast.severity}>
{toast.message}
</Alert>
</Snackbar>
)
}
export default Toaster