From 50e97e7523421b2011ff2c8a1967fdbe9677efa0 Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Sun, 4 Aug 2024 06:07:36 -0700 Subject: [PATCH] remove logs --- src/common/components/shortcuts/globalShortcutsHandler.ts | 2 +- .../aifn/attachmentprompts/useAgiAttachmentPrompts.tsx | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/common/components/shortcuts/globalShortcutsHandler.ts b/src/common/components/shortcuts/globalShortcutsHandler.ts index b4646d883..2a3608f56 100644 --- a/src/common/components/shortcuts/globalShortcutsHandler.ts +++ b/src/common/components/shortcuts/globalShortcutsHandler.ts @@ -16,7 +16,7 @@ function _handleGlobalShortcutKeyDown(event: KeyboardEvent) { // Quicker-out: if the key is null, stop here if (!event.key) return; - console.log('event.key', event.key, event.ctrlKey, event.shiftKey, event.altKey); + // Quick-out: either the key is escape/left/right, or we have a modifier key pressed -- otherwise we exit const lcEventKey = event.key.toLowerCase(); if (lcEventKey !== 'escape' && lcEventKey !== 'arrowleft' && lcEventKey !== 'arrowright' && diff --git a/src/modules/aifn/attachmentprompts/useAgiAttachmentPrompts.tsx b/src/modules/aifn/attachmentprompts/useAgiAttachmentPrompts.tsx index b58bd4903..896253735 100644 --- a/src/modules/aifn/attachmentprompts/useAgiAttachmentPrompts.tsx +++ b/src/modules/aifn/attachmentprompts/useAgiAttachmentPrompts.tsx @@ -10,6 +10,9 @@ import { useShallowStable } from '~/common/util/hooks/useShallowObject'; import { agiAttachmentPrompts } from './agiAttachmentPrompts'; +// interface + + export function useAgiAttachmentPrompts(automatic: boolean, attachmentDrafts: AttachmentDraft[]) { // external state @@ -19,14 +22,14 @@ export function useAgiAttachmentPrompts(automatic: boolean, attachmentDrafts: At const automaticTrigger = automatic && stableFragments.length >= 2; // async operation state - const { data: prompts, error, isPending, isFetching, isLoading, isRefetching, isStale, refetch } = useQuery({ + const { data: prompts, error, isPending, isFetching, refetch } = useQuery({ enabled: automaticTrigger, queryKey: ['aifn-prompts-attachments', ...stableFragments.map(f => f.fId).sort()], queryFn: async ({ signal }) => agiAttachmentPrompts(stableFragments, signal), staleTime: Infinity, // placeholderData: keepPreviousData, }); - console.log('state', { isPending, isFetching, isLoading, isRefetching, isStale }); + // callbacks const handleRefetch = React.useCallback(async () => refetch(), [refetch]);