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: handle empty metadata #2660

Merged
merged 3 commits into from
Oct 19, 2023
Merged

fix: handle empty metadata #2660

merged 3 commits into from
Oct 19, 2023

Conversation

iamacook
Copy link
Member

What it solves

Resolves crashes when metadata is empty

How this PR fixes it

The icon is no longer rendered in the ProposalForm if none is provided in the metadata.icons array, and this dApp is used as a fallback for the metadata.name.

How to test it

Connect to Satellite and observe no error, as well as successful transacting.

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@iamacook iamacook self-assigned this Oct 19, 2023
@github-actions
Copy link

github-actions bot commented Oct 19, 2023

Branch preview

⏳ Deploying a preview site...

@github-actions
Copy link

github-actions bot commented Oct 19, 2023

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@github-actions
Copy link

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.31% (+0.03% 🔼)
9338/12399
🔴 Branches 49.6% 1909/3849
🔴 Functions
57.84% (+0.02% 🔼)
1394/2410
🟡 Lines
76.92% (+0.03% 🔼)
8447/10981
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / useCompatibilityWarning.ts
97.14% (-2.86% 🔻)
100% 100% 100%

Test suite run success

1043 tests passing in 141 suites.

Report generated by 🧪jest coverage report action from 9505a58

src={proposer.metadata.icons[0]}
width={32}
height={32}
alt={`${proposer.metadata.name} logo`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this instance it cannot be empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in cc9fb09.

@iamacook iamacook merged commit e3b3c5f into nect Oct 19, 2023
6 of 9 checks passed
@iamacook iamacook deleted the wc-empty-metadata branch October 19, 2023 09:50
@github-actions github-actions bot locked and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants