Skip to content

Commit

Permalink
wip(images): windows paste bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Dec 6, 2024
1 parent 9f36148 commit 8614826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/components/ChatForm/ChatForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export const ChatForm: React.FC<ChatFormProps> = ({
const { processAndInsertImages } = useAttachedImages();
const handlePastingFile = useCallback(
(event: React.ClipboardEvent<HTMLTextAreaElement>) => {
console.log("handlePasting");

Check warning on line 79 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement

Check warning on line 79 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (latest)

Unexpected console statement
console.log(event);

Check warning on line 80 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement

Check warning on line 80 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (latest)

Unexpected console statement
const files: File[] = [];
const items = event.clipboardData.items;
for (const item of items) {
Expand All @@ -84,6 +86,7 @@ export const ChatForm: React.FC<ChatFormProps> = ({
file && files.push(file);
}
}
console.log({ files });

Check warning on line 89 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement

Check warning on line 89 in src/components/ChatForm/ChatForm.tsx

View workflow job for this annotation

GitHub Actions / build (latest)

Unexpected console statement
if (files.length > 0) {
event.preventDefault();
processAndInsertImages(files);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAttachedImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function processImages(
content: scaledImage,
type: file.type,
};

console.log({ fileForChat });

Check warning on line 83 in src/hooks/useAttachedImages.ts

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement

Check warning on line 83 in src/hooks/useAttachedImages.ts

View workflow job for this annotation

GitHub Actions / build (latest)

Unexpected console statement
onSuccess(fileForChat);
} catch (error) {
if (error === "abort") {
Expand Down

0 comments on commit 8614826

Please sign in to comment.