Open roocell opened 3 days ago
@roocell so basically we have to check if teams
is a null then we have to return an empty array, please currect me if i am wrong?
i think it should be if(teams.length>0)
We will look into this. There are indeed some weird race conditions when signing out.
One note on your code: if you do const user = useUser({ or: 'redirect' })
, the user object is always defined, no need to check it. Also const teams = user.useTeams()
always return an array, so you also don't need to check if the teams is defined
i have a component that displays a list of teams - using the following code
i get this error in the client console
the error just splashes quickly, then (i suspect) the redirect of the sign-out makes it goto the home page.
maybe useTeams() should check if teams is null here?
https://github.com/stack-auth/stack/blob/b9ebd30d105b7a1ba61f3d96a0907596ef6c4e32/packages/stack/src/lib/stack-app.ts#L1627
chrome console log