fix: do not migrate extensions from quick ask window (#2336)

This commit is contained in:
Louis 2024-03-13 01:11:21 +07:00 committed by GitHub
parent 2082b81d64
commit e5369ed151
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,8 @@ import { PropsWithChildren, useEffect, useState } from 'react'
import { Toaster } from 'react-hot-toast' import { Toaster } from 'react-hot-toast'
import { usePathname } from 'next/navigation'
import { TooltipProvider } from '@janhq/uikit' import { TooltipProvider } from '@janhq/uikit'
import GPUDriverPrompt from '@/containers/GPUDriverPromptModal' import GPUDriverPrompt from '@/containers/GPUDriverPromptModal'
@ -29,6 +31,7 @@ import { extensionManager } from '@/extension'
const Providers = (props: PropsWithChildren) => { const Providers = (props: PropsWithChildren) => {
const { children } = props const { children } = props
const pathname = usePathname()
const [setupCore, setSetupCore] = useState(false) const [setupCore, setSetupCore] = useState(false)
const [activated, setActivated] = useState(false) const [activated, setActivated] = useState(false)
@ -40,6 +43,11 @@ const Providers = (props: PropsWithChildren) => {
setTimeout(async () => { setTimeout(async () => {
if (!isCoreExtensionInstalled()) { if (!isCoreExtensionInstalled()) {
// TODO: Proper window handle
// Do not migrate extension from quick ask window
if (pathname === '/search') {
return
}
setSettingUp(true) setSettingUp(true)
await setupBaseExtensions() await setupBaseExtensions()
return return