-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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: removed plain chat from app.cal.com/video #18385
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Graphite Automations"Add consumer team as reviewer" took an action on this PR • (12/27/24)1 reviewer was added to this PR based on Keith Williams's automation. "Add ready-for-e2e label" took an action on this PR • (12/27/24)1 label was added to this PR based on Keith Williams's automation. |
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.
Changes looks fine. could you DM me the plain.com .env vars to test it locally?
sent!! |
E2E results are ready! |
apps/web/lib/plain/plainChat.tsx
Outdated
if (typeof window === "undefined") return 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.
You shouldn't use this
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.
React docs mention that 🔴 Do not call Hooks after a conditional return statement here https://react.dev/warnings/invalid-hook-call-warning
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.
oh yes hooks should be first, this should be below L79
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.
This issue could lead to errors/warning #18385 (comment) because React uses a call stack to associate each hook invocation with its corresponding component instance. If a hook is skipped because a conditional return is encountered, React's internal bookkeeping becomes mismatched, causing errors.
okay, should i use a react usestate instead or put it somewhere else? |
something like this @Udit-takkar ? |
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.
gtg
* fix: removed plain chat from app.cal.com/video * take user session and open plain out of use effect * move undefined check and screen size check above useeffect * turned restrcited paths into env var * undefeined window below hooks * chore: add window check * fix: infinite re rendering * remove console.log --------- Co-authored-by: Udit Takkar <[email protected]>
* fix: removed plain chat from app.cal.com/video * take user session and open plain out of use effect * move undefined check and screen size check above useeffect * turned restrcited paths into env var * undefeined window below hooks * chore: add window check * fix: infinite re rendering * remove console.log --------- Co-authored-by: Udit Takkar <[email protected]>
What does this PR do?
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Make sure to add:
NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS="/video"
Checklist