diff --git a/app/api/storage/r2/uploads/route.ts b/app/api/storage/r2/uploads/route.ts
index cc08985..861cc01 100644
--- a/app/api/storage/r2/uploads/route.ts
+++ b/app/api/storage/r2/uploads/route.ts
@@ -87,10 +87,13 @@ async function createMultipartUpload(
const prefix = (formData.get("prefix") as string) || "";
const plan = await getPlanQuota(user.team!);
+ if (Number(fileSize) > Number(plan.stMaxFileSize)) {
+ return Response.json("File size limit exceeded", { status: 403 });
+ }
const limit = await restrictByTimeRange({
- model: "userUrl",
+ model: "userFile",
userId: user.id,
- limit: Number(plan.stMaxFileSize),
+ limit: Number(plan.stMaxFileCount),
rangeType: "month",
});
if (limit) return Response.json(limit.statusText, { status: limit.status });
diff --git a/components/file/index.tsx b/components/file/index.tsx
index c0035af..74ae86c 100644
--- a/components/file/index.tsx
+++ b/components/file/index.tsx
@@ -206,31 +206,35 @@ export default function UserFileManager({ user, action }: FileListProps) {
{isLoading ? (
) : (
-
+ r2Configs &&
+ r2Configs.buckets &&
+ r2Configs.buckets.length > 0 && (
+
+ )
)}
{!isAdmin && (
diff --git a/components/file/upload-pending.tsx b/components/file/upload-pending.tsx
index 0dc6958..ba5ca94 100644
--- a/components/file/upload-pending.tsx
+++ b/components/file/upload-pending.tsx
@@ -35,10 +35,11 @@ const UploadPending = ({
)}
- {pendingUpload && (
-
- Do not close the window until the upload is complete
-
+ {!pendingUpload && (
+
+
+ {t("Do not close the window until the upload is complete")}
+
)}
{pendingUpload &&
pendingUpload.map((item) => {
diff --git a/components/shared/icons.tsx b/components/shared/icons.tsx
index d9652a3..5dfd436 100644
--- a/components/shared/icons.tsx
+++ b/components/shared/icons.tsx
@@ -31,6 +31,7 @@ import {
Home,
Image,
Inbox,
+ Info,
Laptop,
LayoutGrid,
LayoutPanelLeft,
@@ -323,6 +324,7 @@ export const Icons = {
sun: SunMedium,
trash: Trash2,
inbox: Inbox,
+ info: Info,
twitter: ({ ...props }: LucideProps) => (