fix: unable to start web with quick ask (#2402)

Signed-off-by: James <james@jan.ai>
Co-authored-by: James <james@jan.ai>
This commit is contained in:
NamH 2024-03-17 13:17:39 +07:00 committed by GitHub
parent 5633195f7e
commit 6dfa23cd02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,7 @@ const QuickAskListener: React.FC<Props> = ({ children }) => {
const previousMessage = useRef('')
window.electronAPI.onUserSubmitQuickAsk((_event: string, input: string) => {
window.electronAPI?.onUserSubmitQuickAsk((_event: string, input: string) => {
if (previousMessage.current === input) return
setMainState(MainViewState.Thread)
setShowRightSideBar(false)