-
-
Notifications
You must be signed in to change notification settings - Fork 362
fix(Upload): preview function suppor wasm mode #6889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnhanced the getPreviewUrl implementation to gracefully handle WASM mode by falling back to the inputFile element when the files array is unavailable, and streamlined the lookup logic. Class diagram for updated upload data structure in getPreviewUrlclassDiagram
class Upload {
files
inputFile
}
class InputFile {
files
}
Upload --> InputFile : contains
Flow diagram for getPreviewUrl logic updateflowchart TD
A["getPreviewUrl(id, fileName)"] --> B["upload = Data.get(id)"]
B --> C{"files exists?"}
C -- Yes --> D["fileList = files"]
C -- No --> E["fileList = inputFile.files"]
D --> F["Find file by name"]
E --> F
F --> G{"file found?"}
G -- Yes --> H["url = URL.createObjectURL(file)"]
G -- No --> I["url = ''"]
H --> J["return url"]
I --> J
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the preview function to support WASM mode by modifying the file retrieval logic in the upload module. The change ensures that files can be accessed from either the files property or the inputFile.files property when one is not available.
- Modified file retrieval logic to handle both
filesandinputFile.filesproperties - Simplified conditional structure by removing nested if statements
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6889 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31765 31765
Branches 4466 4466
=========================================
Hits 31765 31765
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #6884
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: