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: nc arguments might be null or an empty array, so we must handle it properly #262

Merged
merged 3 commits into from
May 21, 2024

Conversation

pedroferreira1
Copy link
Member

@pedroferreira1 pedroferreira1 commented May 21, 2024

Motivation

A beta tester was testing a blueprint that has a method without arguments. A transaction with this method was throwing an error in the frontend because the arguments were null. I also improved the UI for an empty list.

Fixes https://github.com/HathorNetwork/internal-issues/issues/305

Acceptance Criteria

  • We should show a single dash (-) when a nano contract transaction has no arguments in the Transaction Detail screen.

image

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

andreabadesso
andreabadesso previously approved these changes May 21, 2024
src/components/tx/TxData.js Outdated Show resolved Hide resolved
andreabadesso
andreabadesso previously approved these changes May 21, 2024
@@ -637,6 +637,10 @@ class TxData extends React.Component {
}

const renderNCArguments = (args) => {
if (!Array.isArray(args) || args.length === 0) {
return " - ";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return " - ";
return ' - ';

@pedroferreira1 pedroferreira1 merged commit a70a5f9 into dev May 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants