fix(uploader): images should display when they've been successfully uploaded #2448
fix(uploader): images should display when they've been successfully uploaded #2448xiaoyatong merged 7 commits intojdf2e:nextfrom
Conversation
Walkthrough此次更改主要集中在 Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #2448 +/- ##
==========================================
+ Coverage 86.01% 86.03% +0.01%
==========================================
Files 217 217
Lines 22863 22857 -6
Branches 2546 2545 -1
==========================================
- Hits 19665 19664 -1
+ Misses 3193 3188 -5
Partials 5 5 ☔ View full report in Codecov by Sentry. |
src/packages/uploader/uploader.tsx
Outdated
| clearUploadQueue(index) | ||
| setFileList( | ||
| fileList.map((item) => { | ||
| [...fileList, fileItem].map((item) => { |
There was a problem hiding this comment.
请添加测试以覆盖新代码。
根据静态分析工具的警告,这一行新增的代码没有被测试覆盖。
Tools
GitHub Check: codecov/patch
[warning] 204-204: src/packages/uploader/uploader.tsx#L204
Added line #L204 was not covered by tests
| readFile(_files) | ||
| } | ||
|
|
||
| setFileList(fileList) |
|
思路2: 通过ref存储最新的状态值 |
经排查,应该是由状态的不正确更新导致的
Summary by CodeRabbit
新功能
修复漏洞
重构