From cfb5732b8fe4aebefae792a32af5b36aba5ba2c9 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Fri, 30 Aug 2024 03:57:53 -0400 Subject: [PATCH] Fix bug where choosing non-vision model prevented being able to paste in textfield --- package.json | 2 +- webview-ui/src/components/ChatView.tsx | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f545bb7..4587e5c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.", - "version": "1.5.0", + "version": "1.5.01", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/webview-ui/src/components/ChatView.tsx b/webview-ui/src/components/ChatView.tsx index 9caf28d..18c2d25 100644 --- a/webview-ui/src/components/ChatView.tsx +++ b/webview-ui/src/components/ChatView.tsx @@ -306,18 +306,13 @@ const ChatView = ({ } const handlePaste = async (e: React.ClipboardEvent) => { - if (shouldDisableImages) { - e.preventDefault() - return - } - const items = e.clipboardData.items const acceptedTypes = ["png", "jpeg", "webp"] // supported by anthropic and openrouter (jpg is just a file extension but the image will be recognized as jpeg) const imageItems = Array.from(items).filter((item) => { const [type, subtype] = item.type.split("/") return type === "image" && acceptedTypes.includes(subtype) }) - if (imageItems.length > 0) { + if (!shouldDisableImages && imageItems.length > 0) { e.preventDefault() const imagePromises = imageItems.map((item) => { return new Promise((resolve) => {