fix: prevent JS error into handleSearchHotKey method when algolia is enabled

pull/4782/head
Mazel 3 months ago committed by GitHub
parent 90f585ab3a
commit c2c087714f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -51,9 +51,9 @@ onMounted(() => {
preconnect()
const handleSearchHotKey = (event: KeyboardEvent) => {
const handleSearchHotKey = (event?: KeyboardEvent) => {
if (
(event.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) ||
(event?.key.toLowerCase() === 'k' && (event.metaKey || event.ctrlKey)) ||
(!isEditingContent(event) && event.key === '/')
) {
event.preventDefault()

Loading…
Cancel
Save