Skip to content

Commit 61a1d13

Browse files
authored
Merge pull request #33 from NCTUCSUnion/dev
Dev
2 parents 8b5a70e + 0d656f4 commit 61a1d13

2 files changed

Lines changed: 31 additions & 3 deletions

File tree

frontend/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@
5353
src="https://cloud.umami.is/script.js"
5454
data-website-id="8089a20a-ba6a-4bf5-b629-8a82c03c134e"
5555
></script>
56+
<script>
57+
if ('serviceWorker' in navigator) {
58+
navigator.serviceWorker.getRegistrations().then(regs => {
59+
for (let r of regs) r.unregister();
60+
});
61+
}
62+
</script>
5663
<script>
5764
function updateFavicon(isDark) {
5865
const theme = isDark ? 'dark' : 'bright'

frontend/src/components/Navbar.vue

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
outlined
7777
aria-label="Logout"
7878
/>
79-
<Button
79+
<!-- <Button
8080
v-else
8181
icon="pi pi-sign-in"
8282
label="登入"
@@ -85,6 +85,16 @@
8585
size="small"
8686
outlined
8787
aria-label="Login"
88+
/> -->
89+
<Button
90+
v-else
91+
icon="pi pi-sign-in"
92+
label="登入"
93+
@click="handleOAuthLogin"
94+
severity="secondary"
95+
size="small"
96+
outlined
97+
aria-label="Login"
8898
/>
8999
</div>
90100

@@ -99,7 +109,7 @@
99109
outlined
100110
aria-label="Logout"
101111
/>
102-
<Button
112+
<!-- <Button
103113
v-else
104114
icon="pi pi-sign-in"
105115
label="登入"
@@ -108,6 +118,16 @@
108118
size="small"
109119
outlined
110120
aria-label="Login"
121+
/> -->
122+
<Button
123+
v-else
124+
icon="pi pi-sign-in"
125+
label="登入"
126+
@click="handleOAuthLogin"
127+
severity="secondary"
128+
size="small"
129+
outlined
130+
aria-label="Login"
111131
/>
112132
</div>
113133

@@ -418,7 +438,8 @@ export default {
418438
419439
handleOAuthLogin() {
420440
this.loginVisible = false
421-
trackEvent(EVENTS.LOGIN_OAUTH, { provider: 'NYCU' })
441+
trackEvent(EVENTS.LOGIN, { type: 'direct-oauth' })
442+
// trackEvent(EVENTS.LOGIN_OAUTH, { provider: 'NYCU' })
422443
authService.login()
423444
},
424445

0 commit comments

Comments
 (0)