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(discover): fix a crash when dapp list is empty #5382

Merged
merged 2 commits into from
May 3, 2024

Conversation

satish-ravi
Copy link
Contributor

Description

Fixes an edge case where if dapps don't load the first time (or comes back as an empty list), navigating to the discover tab crashes the app. This is because we render the dapps section using a boolean condition (categories.length && <SectionList />) and if the array length is 0, it attempts to render 0, which is outside of a Text component

Test plan

Manually by setting dapps list to empty list and ensuring the app no longer crashes

Related issues

N/A

Backwards compatibility

Yes

Network scalability

N/A

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.07%. Comparing base (0852de1) to head (7954804).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5382   +/-   ##
=======================================
  Coverage   86.06%   86.07%           
=======================================
  Files         735      735           
  Lines       29984    29984           
  Branches     5139     5139           
=======================================
+ Hits        25807    25808    +1     
+ Misses       3950     3949    -1     
  Partials      227      227           
Files Coverage Δ
src/dappsExplorer/TabDiscover.tsx 95.76% <100.00%> (+0.84%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0852de1...7954804. Read the comment docs.

@satish-ravi satish-ravi added this pull request to the merge queue May 2, 2024
Merged via the queue into main with commit 5c9ed9f May 3, 2024
16 checks passed
@satish-ravi satish-ravi deleted the satish/fix-tab-discover-crash branch May 3, 2024 00:12
jeanregisser pushed a commit that referenced this pull request May 3, 2024
### Description

Fixes an edge case where if dapps don't load the first time (or comes
back as an empty list), navigating to the discover tab crashes the app.
This is because we render the dapps section using a boolean condition
(`categories.length && <SectionList />`) and if the array length is 0,
it attempts to render `0`, which is outside of a Text component

### Test plan

Manually by setting dapps list to empty list and ensuring the app no
longer crashes

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

N/A
shottah pushed a commit to zed-io/kolektivo that referenced this pull request May 15, 2024
### Description

Fixes an edge case where if dapps don't load the first time (or comes
back as an empty list), navigating to the discover tab crashes the app.
This is because we render the dapps section using a boolean condition
(`categories.length && <SectionList />`) and if the array length is 0,
it attempts to render `0`, which is outside of a Text component

### Test plan

Manually by setting dapps list to empty list and ensuring the app no
longer crashes

### Related issues

N/A

### Backwards compatibility

Yes

### Network scalability

N/A
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.

None yet

2 participants