mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 05:09:12 +03:00
fux
This commit is contained in:
1 parent
d22e60b8d9
commit
15f74a144b
1 file changed
+2
-4
@@ -61,7 +61,7 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
|
||||
const disablePrompts = useFlag('disableAssistantPrompts')
|
||||
const { snippets } = useSqlEditorV2StateSnapshot()
|
||||
const snap = useAiAssistantStateSnapshot()
|
||||
const { closeSidebar } = useSidebarManagerSnapshot()
|
||||
const { closeSidebar, isSidebarOpen } = useSidebarManagerSnapshot()
|
||||
|
||||
const isPaidPlan = selectedOrganization?.plan?.id !== 'free'
|
||||
|
||||
@@ -434,10 +434,8 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
|
||||
}
|
||||
}, [snap.initialInput])
|
||||
|
||||
const isSidebarOpen = sidebarManagerState.isSidebarOpen(SIDEBAR_KEYS.AI_ASSISTANT)
|
||||
|
||||
useEffect(() => {
|
||||
if (isSidebarOpen && isInSQLEditor && !!snippetContent) {
|
||||
if (isSidebarOpen(SIDEBAR_KEYS.AI_ASSISTANT) && isInSQLEditor && !!snippetContent) {
|
||||
snap.setSqlSnippets([{ label: 'Current Query', content: snippetContent }])
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
Reference in new issue
Block a user