mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-02-02 19:18:13 -05:00
🐛 Fix: fix bug that traypage copy link func not work
ISSUES CLOSED: #32
This commit is contained in:
parent
d259a01ec9
commit
acf660946e
@ -63,13 +63,14 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref, onBeforeUnmount, onBeforeMount } from 'vue'
|
import { reactive, ref, onBeforeUnmount, onBeforeMount } from 'vue'
|
||||||
import { ipcRenderer } from 'electron'
|
import { clipboard, ipcRenderer } from 'electron'
|
||||||
import $$db from '@/utils/db'
|
import $$db from '@/utils/db'
|
||||||
import { T as $T } from '@/i18n/index'
|
import { T as $T } from '@/i18n/index'
|
||||||
import { IResult } from '@picgo/store/dist/types'
|
import { IResult } from '@picgo/store/dist/types'
|
||||||
import { PASTE_TEXT, OPEN_WINDOW } from '#/events/constants'
|
import { OPEN_WINDOW } from '#/events/constants'
|
||||||
import { IWindowList } from '#/types/enum'
|
import { IPasteStyle, IWindowList } from '#/types/enum'
|
||||||
import { sendToMain } from '@/utils/dataSender'
|
import { getConfig, sendToMain } from '@/utils/dataSender'
|
||||||
|
import pasteTemplate from '~/main/utils/pasteTemplate'
|
||||||
|
|
||||||
const files = ref<IResult<ImgInfo>[]>([])
|
const files = ref<IResult<ImgInfo>[]>([])
|
||||||
const notification = reactive({
|
const notification = reactive({
|
||||||
@ -92,8 +93,11 @@ async function getData () {
|
|||||||
|
|
||||||
async function copyTheLink (item: ImgInfo) {
|
async function copyTheLink (item: ImgInfo) {
|
||||||
notification.body = item.imgUrl!
|
notification.body = item.imgUrl!
|
||||||
|
const pasteStyle = await getConfig<IPasteStyle>('settings.pasteStyle') || IPasteStyle.MARKDOWN
|
||||||
|
const customLink = await getConfig<string>('settings.customLink')
|
||||||
|
const txt = pasteTemplate(pasteStyle, item, customLink)
|
||||||
|
clipboard.writeText(txt)
|
||||||
const myNotification = new Notification(notification.title, notification)
|
const myNotification = new Notification(notification.title, notification)
|
||||||
ipcRenderer.invoke(PASTE_TEXT, item)
|
|
||||||
myNotification.onclick = () => {
|
myNotification.onclick = () => {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user