Elffuss BraidHub

kikocis/continue public

Merge pull request #6416 from continuedev/pe/drag-and-drop-fix

fix: pasting images
Changeset9df136a0123ef622f71e07aa91a7beffa62cdf36ff2af5fce475f8b1de4e8a30
AuthorDallin Romney <dallinromney@gmail.com> · 2025-07-02 15:21 -07:00
CommitterGitHub <noreply@github.com> · 2025-07-02 15:21 -07:00
Parentsa0c996c3d18a, d8b8e40b1935

Browse the files at this changeset

1 file changed

modified gui/src/components/mainInput/TipTapEditor/utils/editorConfig.ts +13 −11
@@ -155,22 +155,24 @@
155155 for (const item of items) {
156156 const file = item.getAsFile();
157157 file &&
158- void modelSupportsImages(
158+ modelSupportsImages(
159159 model.provider,
160160 model.model,
161161 model.title,
162162 model.capabilities,
163163 ) &&
164- handleImageFile(ideMessenger, file).then((resp) => {
165- if (!resp) return;
166- const [img, dataUrl] = resp;
167- const { schema } = view.state;
168- const node = schema.nodes.image.create({
169- src: dataUrl,
170- });
171- const tr = view.state.tr.insert(0, node);
172- view.dispatch(tr);
173- });
164+ void handleImageFile(ideMessenger, file).then(
165+ (resp) => {
166+ if (!resp) return;
167+ const [img, dataUrl] = resp;
168+ const { schema } = view.state;
169+ const node = schema.nodes.image.create({
170+ src: dataUrl,
171+ });
172+ const tr = view.state.tr.insert(0, node);
173+ view.dispatch(tr);
174+ },
175+ );
174176 }
175177 }
176178 },