Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/components/ChefSignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ function OptInsScreen() {
[convex],
);

const isLoginSuccessful = optIns.kind === 'loaded' && optIns.optIns.length === 0;
useEffect(() => {
if (isLoginSuccessful) {
window.close();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could delay this by a second, depending on what's happening in the other window it could make the interaction feel faster

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whatever feels good

}
}, [isLoginSuccessful]);

if (optIns.kind === 'loading') {
return <Loading />;
}
Expand All @@ -160,7 +167,7 @@ function OptInsScreen() {
);
}

if (optIns.kind === 'loaded' && optIns.optIns.length === 0) {
if (isLoginSuccessful) {
return (
<div className="flex size-full flex-col items-center justify-center">
<div className="text-2xl font-bold">Done logging in!</div>
Expand Down