Skip to content

Commit 9c96870

Browse files
committed
🐛 Fix: fix auto link copy funtion failure bug when using custom format
1 parent 729aad8 commit 9c96870

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/main/apis/app/uploader/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class Uploader {
164164
} as IAnalyticsData)
165165
}
166166
output.forEach((item: ImgInfo) => {
167-
item.config = db.get(`picBed.${item.type}`)
167+
item.config = JSON.parse(JSON.stringify(db.get(`picBed.${item.type}`)))
168168
})
169169
return output.filter(item => item.imgUrl)
170170
} else {

src/renderer/pages/Gallery.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ function handleClose () {
402402
}
403403
404404
async function copy (item: ImgInfo) {
405+
item.config = JSON.parse(JSON.stringify(item.config))
405406
const copyLink = await ipcRenderer.invoke(PASTE_TEXT, item)
406407
const obj = {
407408
title: $T('COPY_LINK_SUCCEED'),

src/renderer/pages/Upload.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@
7676
label="UBB"
7777
title="[img]url[/img]"
7878
/>
79-
<!--TODO 修改title为用户具体设置的格式-->
8079
<el-radio-button
81-
:label="$T('CUSTOM')"
82-
:title="$T('CUSTOM')"
80+
label="Custom"
81+
:title="customLink"
8382
/>
8483
</el-radio-group>
8584
</div>
@@ -140,6 +139,7 @@ const showError = ref(false)
140139
const pasteStyle = ref('')
141140
const picBed = ref<IPicBedType[]>([])
142141
const picBedName = ref('')
142+
const customLink = ref('')
143143
onBeforeMount(() => {
144144
ipcRenderer.on('uploadProgress', (_event: IpcRendererEvent, _progress: number) => {
145145
if (_progress !== -1) {
@@ -242,6 +242,7 @@ function ipcSendFiles (files: FileList) {
242242
243243
async function getPasteStyle () {
244244
pasteStyle.value = await getConfig('settings.pasteStyle') || 'markdown'
245+
customLink.value = await getConfig('settings.customLink') || '$url'
245246
}
246247
247248
function handlePasteStyleChange (val: string | number | boolean) {

0 commit comments

Comments
 (0)