🐛 Fix: fix auto link copy funtion failure bug when using custom format

This commit is contained in:
萌萌哒赫萝 2023-02-21 11:59:26 +08:00
parent 729aad882f
commit 9c96870563
3 changed files with 6 additions and 4 deletions

View File

@ -164,7 +164,7 @@ class Uploader {
} as IAnalyticsData)
}
output.forEach((item: ImgInfo) => {
item.config = db.get(`picBed.${item.type}`)
item.config = JSON.parse(JSON.stringify(db.get(`picBed.${item.type}`)))
})
return output.filter(item => item.imgUrl)
} else {

View File

@ -402,6 +402,7 @@ function handleClose () {
}
async function copy (item: ImgInfo) {
item.config = JSON.parse(JSON.stringify(item.config))
const copyLink = await ipcRenderer.invoke(PASTE_TEXT, item)
const obj = {
title: $T('COPY_LINK_SUCCEED'),

View File

@ -76,10 +76,9 @@
label="UBB"
title="[img]url[/img]"
/>
<!--TODO 修改title为用户具体设置的格式-->
<el-radio-button
:label="$T('CUSTOM')"
:title="$T('CUSTOM')"
label="Custom"
:title="customLink"
/>
</el-radio-group>
</div>
@ -140,6 +139,7 @@ const showError = ref(false)
const pasteStyle = ref('')
const picBed = ref<IPicBedType[]>([])
const picBedName = ref('')
const customLink = ref('')
onBeforeMount(() => {
ipcRenderer.on('uploadProgress', (_event: IpcRendererEvent, _progress: number) => {
if (_progress !== -1) {
@ -242,6 +242,7 @@ function ipcSendFiles (files: FileList) {
async function getPasteStyle () {
pasteStyle.value = await getConfig('settings.pasteStyle') || 'markdown'
customLink.value = await getConfig('settings.customLink') || '$url'
}
function handlePasteStyleChange (val: string | number | boolean) {