Skip to content

Commit 349266f

Browse files
authored
Fix uploading empty files (codesandbox#3404)
* Fix uploading empty files. * Remove unneeded check.
1 parent 941efce commit 349266f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/app/src/app/overmind/namespaces/files/internalActions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export const uploadFiles: AsyncAction<
9999
file.type === 'application/json') &&
100100
dataURI.length < MAX_FILE_SIZE
101101
) {
102-
const text = dataURI ? atob(dataURI.replace(/^.*base64,/, '')) : '';
102+
const text =
103+
dataURI !== 'data:' ? atob(dataURI.replace(/^.*base64,/, '')) : '';
103104
parsedFiles[filePath] = {
104105
content: text,
105106
isBinary: false,

0 commit comments

Comments
 (0)