-
Notifications
You must be signed in to change notification settings - Fork 158
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: avoid showing "No items found" stats in <ItemsList />
#559
Conversation
islands/ItemsList.tsx
Outdated
{isLoadingSig.value !== undefined && !isLoadingSig.value | ||
? itemsSig.value.length > 0 | ||
? itemsSig.value.map((item, id) => { | ||
return ( | ||
<ItemSummary | ||
key={item.id} | ||
item={item} | ||
isVoted={itemsAreVotedSig.value[id]} | ||
isSignedIn={props.isSignedIn} | ||
/> | ||
); | ||
}) | ||
: <EmptyItemsList /> | ||
: "█"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this a little more readable, please? I think we should avoid nesting ternary operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing
<ItemsList />
@iuioiua man! how right you were. This reads way better. |
After seeing this PR I cannot help but wonder what was I doing this whole time? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a couple of tweaks, and now LGTM. Thank you.
fixes #472
@iuioiua this is as simple as I got, without being too intrusive; I personally like it; the problem was a bug regarding the state change of the variable
isLoadingSig
, I was able to avoid it by initializing the variable asundefined
and bypassing it with the conditional rendering not sure if is worth taking another look at it some other time.Note: The simplicity of this PR does not reflect at all the time that took me to get there — just for the record.