-
Notifications
You must be signed in to change notification settings - Fork 9
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
AgentEinstein/add error checking #863
Conversation
AgentEinstein
commented
Nov 5, 2023
…to AgentEinstein/SuccessfullyUpdated
…to AgentEinstein/AddErrorChecking
src/components/dynamic/user/Team.jsx
Outdated
@@ -37,6 +37,10 @@ const Team = ({ user, setUser }) => { | |||
}; | |||
|
|||
const handleJoin = () => { | |||
if (id.team.length === 0) { |
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.
u can just check for an empty string instead of character comparison
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.
fixed
src/components/dynamic/user/Team.jsx
Outdated
@@ -37,6 +37,10 @@ const Team = ({ user, setUser }) => { | |||
}; | |||
|
|||
const handleJoin = () => { | |||
if (id.team == null) { |
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.
triple equals and it should just be checking for empty string and not null
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.
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.
On the other hand, !id.team seems to work, did you prefer that implementation instead?
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.
what are the initial values for the id.team?
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.
it's probably empty
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.
check the values and do a type check for it instead of a general null check