Pārlūkot izejas kodu

Fix bad example for setFileState (#4191)

* Fix bad example for setFileState

* Apply suggestions from code review
Tim Whitney 2 gadi atpakaļ
vecāks
revīzija
cc4c52af6c
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      website/src/docs/core.md

+ 6 - 1
website/src/docs/core.md

@@ -622,7 +622,12 @@ Update the state for a single file. This is mostly useful for plugins that may w
 `fileID` is the string file ID. `state` is an object that will be merged into the file’s state object.
 
 ```js
-uppy.getPlugin('Url').addFile('path/to/remote-file.jpg')
+uppy.getFiles().forEach(file => {
+  // Mark all files as uploaded and complete.
+  uppy.setFileState(file.id, {
+    progress: { uploadComplete: true, uploadStarted: true },
+  })
+})
 ```
 
 ### `uppy.setMeta(data)`