Skip to content
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

fix(client): react render logic #702

Merged
merged 2 commits into from
Dec 10, 2023
Merged

Conversation

hmerritt
Copy link
Contributor

fix(client): react render logic

A couple react related fixes. One fixes a console error, the other an unwanted rendered result.

Description

  • Fix: key={} must be set on the rendered component (cannot be passed down and set within the component)
  • Fix: conditional rendering via && must be a conditional statement (not relying on value truthy/falsy) otherwise a 0 value will be rendered
    • Using != to fix instead of !== because it catches both null and undefined values

Related Issue

N/A

Screenshots

Screenshot 2023-12-09 234933

Before / After
Screenshot 2023-12-09 235115
Screenshot 2023-12-09 235057

Types of changes

  • Breaking change (changes that break backward compatibility of public API or CLI - semver MAJOR)
  • New feature (non-breaking change which adds functionality - semver MINOR)
  • Bug fix (non-breaking change which fixes an issue - semver PATCH)

Copy link

codecov bot commented Dec 10, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1781ecf) 72.27% compared to head (605fb79) 72.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #702      +/-   ##
==========================================
+ Coverage   72.27%   72.30%   +0.02%     
==========================================
  Files          62       62              
  Lines       11384    11384              
  Branches      938      937       -1     
==========================================
+ Hits         8228     8231       +3     
+ Misses       3142     3139       -3     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trim21
Copy link
Collaborator

trim21 commented Dec 10, 2023

how can I re-produce first image (before)?

@hmerritt
Copy link
Contributor Author

how can I re-produce first image (before)?

If you add a torrent with a magnet link, the file-size is unknown before the metadata is downloaded (which usually happens quite quickly) - I had a torrent with basically 0 seeders so it never downloaded the metadata - and the filesize logic in the UI rendered 0.

@trim21 trim21 merged commit eaefd4c into jesec:master Dec 10, 2023
12 checks passed
@hmerritt hmerritt deleted the fix/react-logic branch December 10, 2023 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants