From 9e7b950cda0a70f9d5ae36eb481f07910f53a1ab Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Thu, 9 Jan 2025 15:08:27 -0800 Subject: [PATCH] Attachments: rename enableLoadURLsOnPaste --- src/common/attachment-drafts/useAttachmentDrafts.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/attachment-drafts/useAttachmentDrafts.tsx b/src/common/attachment-drafts/useAttachmentDrafts.tsx index 5472bf21d..6222ffc55 100644 --- a/src/common/attachment-drafts/useAttachmentDrafts.tsx +++ b/src/common/attachment-drafts/useAttachmentDrafts.tsx @@ -20,7 +20,7 @@ import type { AttachmentDraftsStoreApi } from './store-attachment-drafts_slice'; const ATTACHMENTS_DEBUG_INTAKE = false; -export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreApi | null, enableLoadURLs: boolean, hintAddImages: boolean, onFilterAGIFile: (file: File) => Promise) => { +export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreApi | null, enableLoadURLsOnPaste: boolean, hintAddImages: boolean, onFilterAGIFile: (file: File) => Promise) => { // state const { _createAttachmentDraft, attachmentDrafts, attachmentsRemoveAll, attachmentsTakeAllFragments, attachmentsTakeFragmentsByType } = useChatAttachmentsStore(attachmentsStoreApi, useShallow(state => ({ @@ -145,7 +145,7 @@ export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreAp // attach as URL const textPlain = dt.getData('text/plain') || ''; - if (textPlain && enableLoadURLs) { + if (textPlain && enableLoadURLsOnPaste) { const textPlainUrl = asValidURL(textPlain); if (textPlainUrl && textPlainUrl.trim()) { void _createAttachmentDraft({ @@ -170,7 +170,7 @@ export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreAp // did not attach anything from this data transfer return false; - }, [_createAttachmentDraft, attachAppendFile, enableLoadURLs, hintAddImages]); + }, [_createAttachmentDraft, attachAppendFile, enableLoadURLsOnPaste, hintAddImages]); /** * Append clipboard items to the attachments. @@ -223,7 +223,7 @@ export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreAp const textPlain = clipboardItem.types.includes('text/plain') ? await clipboardItem.getType('text/plain').then(blob => blob.text()) : ''; // attach as URL - if (textPlain && enableLoadURLs) { + if (textPlain && enableLoadURLsOnPaste) { const textPlainUrl = asValidURL(textPlain); if (textPlainUrl && textPlainUrl.trim()) { void _createAttachmentDraft({ @@ -243,7 +243,7 @@ export const useAttachmentDrafts = (attachmentsStoreApi: AttachmentDraftsStoreAp console.warn('Clipboard item has no text/html or text/plain item.', clipboardItem.types, clipboardItem); } - }, [_createAttachmentDraft, attachAppendFile, enableLoadURLs, hintAddImages]); + }, [_createAttachmentDraft, attachAppendFile, enableLoadURLsOnPaste, hintAddImages]); /** * Append ego content to the attachments.