Skip to content

Commit

Permalink
Chore: Desktop: Fixes #8572: Fix warning when pasting images with dat…
Browse files Browse the repository at this point in the history
…a URI srcs (#8574)
  • Loading branch information
personalizedrefrigerator committed Jul 29, 2023
1 parent 31f8e72 commit 7140675
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/app-desktop/gui/NoteEditor/utils/resourceHandling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ export async function processPastedHtml(html: string) {
const createdResource = await shim.createResourceFromPath(imageFilePath);
mappedResources[imageSrc] = `file://${encodeURI(Resource.fullPath(createdResource))}`;
}
} else if (imageSrc.startsWith('data:')) { // Data URIs
mappedResources[imageSrc] = imageSrc;
} else {
const filePath = `${Setting.value('tempDir')}/${md5(Date.now() + Math.random())}`;
await shim.fetchBlob(imageSrc, { path: filePath });
Expand Down

0 comments on commit 7140675

Please sign in to comment.