Skip to content

Commit c52eb3d

Browse files
committed
fix isAuthenticated logic in auth provider, remove legacyBehavior link props, fix ux for setting isLoading after joining an organization
1 parent 2f5d3f1 commit c52eb3d

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/components/modals/join-organization.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,20 @@ export function JoinOrganizationModal({ open, onOpenChange }: JoinOrganizationMo
4444
setErrors({
4545
'join-organization': [result.message || 'Failed to join organization'],
4646
});
47+
setLoading(false);
4748
} else if (result.errors) {
4849
setErrors(result.errors);
50+
setLoading(false);
4951
} else {
5052
setErrors({
5153
'join-organization': ['Failed to join organization'],
5254
});
55+
setLoading(false);
5356
}
5457
} catch (error: any) {
5558
setErrors({
5659
'join-organization': [error?.message || 'Failed to join organization'],
5760
});
58-
} finally {
5961
setLoading(false);
6062
}
6163
};

src/components/roadmap/propose-cta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const RoadmapProposeCta = (props: RoadmapProposeCtaProps) => {
2626
Propose Feature
2727
</Button>
2828
) : (
29-
<Link href={routes.auth.signIn} passHref legacyBehavior>
29+
<Link href={routes.auth.signIn}>
3030
<Button
3131
asChild
3232
onClick={() => toast.info('You must be logged in to propose a feature')}

src/components/roadmap/vote-cta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const RoadmapVoteCta = (props: RoadmapVoteCta) => {
4343

4444
if (!currentUserId) {
4545
return (
46-
<Link href={routes.auth.signIn} passHref legacyBehavior>
46+
<Link href={routes.auth.signIn}>
4747
<Button
4848
asChild
4949
variant="ghost"

src/providers/auth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const AuthProvider = (props: AuthProviderProps) => {
5050
} = await supabase.auth.getUser();
5151

5252
setUser(userFromSupabase);
53-
setIsAuthenticated(Boolean(user));
53+
setIsAuthenticated(Boolean(userFromSupabase));
5454

5555
if (userFromSupabase) {
5656
const { data: agentsmithUser } = await supabase

0 commit comments

Comments
 (0)