Skip to content

Commit 37f1b25

Browse files
committed
fix: only allow kawaii search key and not something else
1 parent d5cab9c commit 37f1b25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/pages/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ defineOgImageComponent('Default', {
2828
// const route = useRoute()
2929
// const isKawaii = computed(() => route.query.kawaii === 'true')
3030
onPrehydrate(el => {
31-
const isKawaii = window.location.search.includes('kawaii=true')
31+
const params = new URLSearchParams(window.location.search)
32+
const isKawaii = params.get('kawaii') === 'true'
3233
const normal = el.querySelector('#npmx-index-h1-logo-normal') as HTMLElement
3334
const kawaii = el.querySelector('#npmx-index-h1-logo-kawaii') as HTMLElement
3435
const env = el.querySelector('#npmx-index-h1-logo-env') as HTMLElement

0 commit comments

Comments
 (0)