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:
16
frontend/src/hooks/toast.ts
Normal file
16
frontend/src/hooks/toast.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { useDispatch } from "react-redux"
|
||||
import { setMessage } from "../features/ui/toastSlice"
|
||||
import { AlertColor } from "@mui/material"
|
||||
|
||||
export const useToast = () => {
|
||||
const dispatch = useDispatch()
|
||||
|
||||
return {
|
||||
pushMessage: (message: string, severity?: AlertColor) => {
|
||||
dispatch(setMessage({
|
||||
message: message,
|
||||
severity: severity
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user