Skip to content

Commit

Permalink
React: Remove unneeded async function in ConvexAuthState (#28407)
Browse files Browse the repository at this point in the history
It has no impact, it was left over from when the setAuth call used to be async.

GitOrigin-RevId: 673eb6f18f97433a5ab300c75bd001899878dd7f
  • Loading branch information
xixixao authored and Convex, Inc. committed Jul 30, 2024
1 parent 99e7e80 commit 93cdba5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions npm-packages/convex/src/react/ConvexAuthState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,12 @@ export function ConvexProviderWithAuth({

useEffect(() => {
let isThisEffectRelevant = true;

async function setToken() {
if (isAuthenticated) {
client.setAuth(fetchAccessToken, (isAuthenticated) => {
if (isThisEffectRelevant) {
setIsConvexAuthenticated(isAuthenticated);
}
});
}

if (isAuthenticated) {
void setToken();
return () => {
isThisEffectRelevant = false;

Expand Down

0 comments on commit 93cdba5

Please sign in to comment.