feat: chunk uploads (#76)
* add first concept * finished first concept * allow 3 uploads at same time * retry if chunk failed * updated clean temporary files job * fix throttling for chunk uploads * update tests * remove multer * migrate from `MAX_FILE_SIZE` to `MAX_SHARE_SIZE` * improve error handling if file failed to upload * fix promise limit * improve file progress
This commit is contained in:
@@ -1,25 +1,33 @@
|
||||
import { showNotification } from "@mantine/notifications";
|
||||
import { NotificationProps, showNotification } from "@mantine/notifications";
|
||||
import { TbCheck, TbX } from "react-icons/tb";
|
||||
const error = (message: string) =>
|
||||
const error = (message: string, config?: Omit<NotificationProps, "message">) =>
|
||||
showNotification({
|
||||
icon: <TbX />,
|
||||
color: "red",
|
||||
radius: "md",
|
||||
title: "Error",
|
||||
|
||||
message: message,
|
||||
|
||||
autoClose: true,
|
||||
|
||||
...config,
|
||||
});
|
||||
|
||||
const axiosError = (axiosError: any) =>
|
||||
error(axiosError?.response?.data?.message ?? "An unknown error occurred");
|
||||
|
||||
const success = (message: string) =>
|
||||
const success = (
|
||||
message: string,
|
||||
config?: Omit<NotificationProps, "message">
|
||||
) =>
|
||||
showNotification({
|
||||
icon: <TbCheck />,
|
||||
color: "green",
|
||||
radius: "md",
|
||||
title: "Success",
|
||||
message: message,
|
||||
autoClose: true,
|
||||
...config,
|
||||
});
|
||||
|
||||
const toast = {
|
||||
|
||||
Reference in New Issue
Block a user