Skip to content

Commit

Permalink
fix: window not defined in ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
ddiu8081 committed May 10, 2023
1 parent 5add915 commit d83c17c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { onMount } from 'solid-js'
import { scrollController, showConversationSidebar, showSettingsSidebar } from '@/stores/ui'
import { useLargeScreen } from '@/hooks'
import ConversationHeaderInfo from './ConversationHeaderInfo'
import ConversationMessageClearButton from './ConversationMessageClearButton'

export default () => {
useLargeScreen(() => {
// bug: when click the setting btn, toggle moible or PC mode, the sidebar will not close
showConversationSidebar.set(false)
showSettingsSidebar.set(false)
onMount(() => {
useLargeScreen(() => {
// bug: when click the setting btn, toggle moible or PC mode, the sidebar will not close
showConversationSidebar.set(false)
showSettingsSidebar.set(false)
})
})
return (
<header onDblClick={scrollController().scrollToTop} class="shrink-0 absolute top-0 left-0 right-0 fi justify-between bg-base-100 border-b border-base h-14 px-4">
Expand Down

0 comments on commit d83c17c

Please sign in to comment.