mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
append generated id to file name
This commit is contained in:
@@ -16,6 +16,7 @@ import { projectScope } from "@src/atoms/projectScope";
|
||||
import { firebaseStorageAtom } from "@src/sources/ProjectSourceFirebase";
|
||||
import { WIKI_LINKS } from "@src/constants/externalLinks";
|
||||
import { FileValue } from "@src/types/table";
|
||||
import { generateId } from "@src/utils/table";
|
||||
|
||||
export type UploadState = {
|
||||
progress: number;
|
||||
@@ -85,7 +86,7 @@ const useFirebaseStorageUploader = () => {
|
||||
|
||||
const storageRef = ref(
|
||||
firebaseStorage,
|
||||
`${docRef.path}/${fieldName}/${file.name}`
|
||||
`${docRef.path}/${fieldName}/${generateId()}-${file.name}`
|
||||
);
|
||||
const uploadTask = uploadBytesResumable(storageRef, file, {
|
||||
cacheControl: "public, max-age=31536000",
|
||||
|
||||
Reference in New Issue
Block a user