Refactored some of the GoLinksContainer, fixed issue #139 #249
No reviewers
Labels
No labels
accessibility
api
auth.js
backend
copy
database
defect
dependencies
design
discussion
documentation
duplicate
enhancement
epic
feature
front-end
good first issue
help wanted
invalid
next.js
noscript
on hold
operations
optimization
postgresql
prisma
prototype
question
react
spike
stale
story
tailwind
vulnerability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
SSE/WebsiteTheSSEquel!249
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "golink-container-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I changed the GoLinksContainer file to use ternary operators within the return instead of conditionally returning two nearly identical objects with only the inclusion of the GoLinkData changes.
Then, I added a condition to display the "Loading..." message only when the GoLinkData list contains a link with id -1, and I set the default value of the GoLinkData to a single element with id -1. Once the fetch for GoLinks is finished, it would be replaced with valid GoLinks (id != -1) or an empty list, which is checked to display "No GoLinks available".
Sweet. LGTM! 🚀