Skip to content

Commit 155dceb

Browse files
committed
fix(ui): provide fallback for crypto.randomUUID
1 parent c5f751d commit 155dceb

File tree

1 file changed

+3
-1
lines changed
  • packages/ui/src/elements/BulkUpload/FormsManager

1 file changed

+3
-1
lines changed

packages/ui/src/elements/BulkUpload/FormsManager/reducer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { FormState, UploadEdits } from 'payload'
22

3+
import { v4 as uuidv4 } from 'uuid'
4+
35
export type State = {
46
activeIndex: number
57
forms: {
@@ -50,7 +52,7 @@ export function formsManagementReducer(state: State, action: Action): State {
5052
for (let i = 0; i < action.files.length; i++) {
5153
newForms[i] = {
5254
errorCount: 0,
53-
formID: crypto.randomUUID(),
55+
formID: crypto.randomUUID ? crypto.randomUUID() : uuidv4(),
5456
formState: {
5557
...(action.initialState || {}),
5658
file: {

0 commit comments

Comments
 (0)