🐛 Fix(custom): fix gallery copy bug of aws-s3

This commit is contained in:
Kuingsmile
2024-01-20 00:40:54 -08:00
parent 48ec494e73
commit 0e81ccdf81
2 changed files with 7 additions and 1 deletions

View File

@@ -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)

View File

@@ -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)
}