Skip to content

Commit 92aa5a6

Browse files
committed
fix: dispatch authEvent when creating a new account with google
1 parent c852ff5 commit 92aa5a6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

frontend/src/ts/modals/google-sign-up.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { resetIgnoreAuthCallback } from "../firebase";
2121
import { ValidatedHtmlInputElement } from "../elements/input-validation";
2222
import { UserNameSchema } from "@monkeytype/schemas/users";
2323
import { remoteValidation } from "../utils/remote-validation";
24+
import { authEvent } from "../events/auth";
2425

2526
let signedInUser: UserCredential | undefined = undefined;
2627

@@ -109,6 +110,11 @@ async function apply(): Promise<void> {
109110
showSuccessNotification("Account created");
110111
await AccountController.loadUser(signedInUser.user);
111112

113+
authEvent.dispatch({
114+
type: "authStateChanged",
115+
data: { isUserSignedIn: true, loadPromise: Promise.resolve() },
116+
});
117+
112118
signedInUser = undefined;
113119
hideLoaderBar();
114120
void hide();

0 commit comments

Comments
 (0)