diff --git a/src/main/utils/pasteTemplate.ts b/src/main/utils/pasteTemplate.ts index 18e21a1a..0687d539 100644 --- a/src/main/utils/pasteTemplate.ts +++ b/src/main/utils/pasteTemplate.ts @@ -24,7 +24,10 @@ export const formatCustomLink = (customLink: string, item: ImgInfo) => { export default async (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) => { let url = item.url || item.imgUrl - url = handleUrlEncodeWithSetting(item.url || item.imgUrl) + if (item.type === 'aws-s3' || item.type === 'aws-s3-plist') { + url = item.imgUrl || item.url || '' + } + url = handleUrlEncodeWithSetting(url) const useShortUrl = db.get('settings.useShortUrl') || false if (useShortUrl) { url = await generateShortUrl(url) diff --git a/src/renderer/pages/TrayPage.vue b/src/renderer/pages/TrayPage.vue index e2f0b7fa..24a1bcf8 100644 --- a/src/renderer/pages/TrayPage.vue +++ b/src/renderer/pages/TrayPage.vue @@ -140,6 +140,9 @@ async function copyTheLink (item: ImgInfo) { async function pasteTemplate (style: IPasteStyle, item: ImgInfo, customLink: string | undefined) { let url = item.url || item.imgUrl + if (item.type === 'aws-s3' || item.type === 'aws-s3-plist') { + url = item.imgUrl || item.url || '' + } if ((await getConfig('settings.encodeOutputURL')) === true) { url = handleUrlEncode(url) }