mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix bug where choosing non-vision model prevented being able to paste in textfield
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"displayName": "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.",
|
"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",
|
"icon": "icon.png",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.84.0"
|
"vscode": "^1.84.0"
|
||||||
|
|||||||
@@ -306,18 +306,13 @@ const ChatView = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handlePaste = async (e: React.ClipboardEvent) => {
|
const handlePaste = async (e: React.ClipboardEvent) => {
|
||||||
if (shouldDisableImages) {
|
|
||||||
e.preventDefault()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const items = e.clipboardData.items
|
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 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 imageItems = Array.from(items).filter((item) => {
|
||||||
const [type, subtype] = item.type.split("/")
|
const [type, subtype] = item.type.split("/")
|
||||||
return type === "image" && acceptedTypes.includes(subtype)
|
return type === "image" && acceptedTypes.includes(subtype)
|
||||||
})
|
})
|
||||||
if (imageItems.length > 0) {
|
if (!shouldDisableImages && imageItems.length > 0) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
const imagePromises = imageItems.map((item) => {
|
const imagePromises = imageItems.map((item) => {
|
||||||
return new Promise<string | null>((resolve) => {
|
return new Promise<string | null>((resolve) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user