mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Attachments: support image-only
This commit is contained in:
@@ -194,6 +194,13 @@ export function useAttachmentDrafts(attachmentsStoreApi: AttachmentDraftsStoreAp
|
||||
|
||||
// attach as Text/Html (further conversion, e.g. to markdown is done later)
|
||||
if (attachText && (textHtml || textPlain)) {
|
||||
|
||||
// only-images: skip this data transfer text attachment
|
||||
if (filterOnlyImages) {
|
||||
notifyOnlyImages(textPlain || textHtml);
|
||||
return false;
|
||||
}
|
||||
|
||||
void _createAttachmentDraft({
|
||||
media: 'text', method, textPlain, textHtml,
|
||||
}, { hintAddImages });
|
||||
@@ -206,7 +213,7 @@ export function useAttachmentDrafts(attachmentsStoreApi: AttachmentDraftsStoreAp
|
||||
|
||||
// did not attach anything from this data transfer
|
||||
return false;
|
||||
}, [_createAttachmentDraft, attachAppendFile, attachAppendUrl, enableLoadURLsOnPaste, hintAddImages]);
|
||||
}, [_createAttachmentDraft, attachAppendFile, attachAppendUrl, enableLoadURLsOnPaste, filterOnlyImages, hintAddImages]);
|
||||
|
||||
/**
|
||||
* Append clipboard items to the attachments.
|
||||
@@ -275,6 +282,13 @@ export function useAttachmentDrafts(attachmentsStoreApi: AttachmentDraftsStoreAp
|
||||
|
||||
// attach as Text
|
||||
if (textHtml || textPlain) {
|
||||
|
||||
// only-images: skip this clipboard text attachment
|
||||
if (filterOnlyImages) {
|
||||
notifyOnlyImages(textPlain || textHtml);
|
||||
return false;
|
||||
}
|
||||
|
||||
void _createAttachmentDraft({
|
||||
media: 'text', method: 'clipboard-read', textPlain, textHtml,
|
||||
}, { hintAddImages });
|
||||
|
||||
Reference in New Issue
Block a user