hicetnunc
hicetnunc copied to clipboard
Cleanup - Replace nested if statements
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 writingnull
orundefined
would have the same outcome -
this.state.copied
has been renamed tothis.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