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

Cleanup - Replace nested if statements #1334

Open
wants to merge 3,742 commits into
base: main
Choose a base branch
from

Conversation

TezzardzGoneWild
Copy link
Contributor

Several sections of code received some clean up, but no functionality change:

  • onReady included a nested if statement that could be expressed using a single if statement
  • the nested if statement used for filtering OBJKT sale type within creationsForSale can be expressed with two one-line if statements
  • metadata fields are set to null when the state is initialized to give a better indication of what will happen within the component
  • instances where getUserMetadata is called wrote to an intermediate variable and had multiple unnecessary if statements where writing null or undefined would have the same outcome
  • this.state.copied has been renamed to this.state.discordLinkCopied for clarity

Large if / else blocks can be intimidating to new contributors, and the main goal of this PR is to reduce the barriers for new developers wanting to contribute. Reducing the complexity of these functions should help with attracting new developers and preventing unintended side effects when touching these areas

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