Skip to content

Commit 21001e9

Browse files
Merge pull request #1035 from nextcloud/fix/file-id-generation
fix: generate file id when validating image uploads
2 parents c6c5fff + 366f8c3 commit 21001e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,9 @@ export default function App({
434434
const maxSizeMb = maxImageSizeMb ?? 0
435435
throw new Error(t('whiteboard', 'Max image size is {max} MB', { max: maxSizeMb }))
436436
}
437-
// Return empty string so Excalidraw falls back to its default ID generator.
438-
return ''
437+
438+
// must return an id, excalidraws id generator only runs when the callback prop is not set
439+
return Array.from({ length: 40 }, () => Math.floor(Math.random() * 16).toString(16)).join('')
439440
}, [maxImageSizeBytes, maxImageSizeMb])
440441

441442
const handleOnChange = useCallback(() => {

0 commit comments

Comments
 (0)