Skip to content

Commit cc4c52a

Browse files
authored
Fix bad example for setFileState (transloadit#4191)
* Fix bad example for setFileState * Apply suggestions from code review
1 parent 473796b commit cc4c52a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

website/src/docs/core.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,12 @@ Update the state for a single file. This is mostly useful for plugins that may w
622622
`fileID` is the string file ID. `state` is an object that will be merged into the file’s state object.
623623

624624
```js
625-
uppy.getPlugin('Url').addFile('path/to/remote-file.jpg')
625+
uppy.getFiles().forEach(file => {
626+
// Mark all files as uploaded and complete.
627+
uppy.setFileState(file.id, {
628+
progress: { uploadComplete: true, uploadStarted: true },
629+
})
630+
})
626631
```
627632

628633
### `uppy.setMeta(data)`

0 commit comments

Comments
 (0)