Skip to content

Commit 10b90b0

Browse files
committed
fix: fix unit test for root page
1 parent 9a33348 commit 10b90b0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/pages/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function handleGithubSignIn() {
2323
redirect_uri: githubRedirectUri,
2424
scope: githubScope,
2525
});
26-
window.open(
26+
window?.open(
2727
`https://github.com/login/oauth/authorize?${params.toString()}`,
2828
'github-oauth',
2929
`width=500,height=600,top=${(screen.height - 600) / 2},left=${(screen.width - 500) / 2}`,
@@ -33,15 +33,15 @@ function handleGithubSignIn() {
3333
onMounted(() => {
3434
// Wait for Google script to load
3535
const checkGoogle = setInterval(() => {
36-
if (window.google) {
36+
if (window?.google) {
3737
initializeGoogleButton('google-signin-btn');
3838
clearInterval(checkGoogle);
3939
}
4040
}, 100);
4141
4242
// Listen for GitHub auth messages from popup
4343
window?.addEventListener('message', (event) => {
44-
if (event.origin !== window.location.origin) return;
44+
if (event.origin !== window?.location.origin) return;
4545
if (event.data.type === 'github-auth') {
4646
navigateTo('/auth/callback/github?code=' + event.data.code);
4747
}

0 commit comments

Comments
 (0)