mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-23 14:48:13 -05:00
Fixed: sync upload img to gallery
This commit is contained in:
parent
e0bb8480a2
commit
cf504a0173
@ -352,6 +352,9 @@ const uploadClipboardFiles = async () => {
|
|||||||
icon: img[0].imgUrl
|
icon: img[0].imgUrl
|
||||||
})
|
})
|
||||||
notification.show()
|
notification.show()
|
||||||
|
img.forEach(item => {
|
||||||
|
db.read().get('uploaded').insert(item).write()
|
||||||
|
})
|
||||||
window.webContents.send('clipboardFiles', [])
|
window.webContents.send('clipboardFiles', [])
|
||||||
window.webContents.send('uploadFiles', img)
|
window.webContents.send('uploadFiles', img)
|
||||||
if (settingWindow) {
|
if (settingWindow) {
|
||||||
@ -397,8 +400,11 @@ ipcMain.on('uploadClipboardFiles', async (evt, file) => {
|
|||||||
icon: img[0].imgUrl
|
icon: img[0].imgUrl
|
||||||
})
|
})
|
||||||
notification.show()
|
notification.show()
|
||||||
|
img.forEach(item => {
|
||||||
|
db.read().get('uploaded').insert(item).write()
|
||||||
|
})
|
||||||
window.webContents.send('clipboardFiles', [])
|
window.webContents.send('clipboardFiles', [])
|
||||||
window.webContents.send('uploadFiles', img)
|
window.webContents.send('uploadFiles')
|
||||||
if (settingWindow) {
|
if (settingWindow) {
|
||||||
settingWindow.webContents.send('updateGallery')
|
settingWindow.webContents.send('updateGallery')
|
||||||
}
|
}
|
||||||
@ -428,6 +434,9 @@ ipcMain.on('uploadChoosedFiles', async (evt, files) => {
|
|||||||
}, i * 100)
|
}, i * 100)
|
||||||
}
|
}
|
||||||
clipboard.writeText(pasteText)
|
clipboard.writeText(pasteText)
|
||||||
|
imgs.forEach(item => {
|
||||||
|
db.read().get('uploaded').insert(item).write()
|
||||||
|
})
|
||||||
window.webContents.send('uploadFiles', imgs)
|
window.webContents.send('uploadFiles', imgs)
|
||||||
if (settingWindow) {
|
if (settingWindow) {
|
||||||
settingWindow.webContents.send('updateGallery')
|
settingWindow.webContents.send('updateGallery')
|
||||||
|
@ -104,7 +104,9 @@ export default {
|
|||||||
created () {
|
created () {
|
||||||
this.getGallery()
|
this.getGallery()
|
||||||
this.$electron.ipcRenderer.on('updateGallery', (event) => {
|
this.$electron.ipcRenderer.on('updateGallery', (event) => {
|
||||||
this.filterList = this.getGallery()
|
this.$nextTick(() => {
|
||||||
|
this.filterList = this.getGallery()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -54,10 +54,7 @@
|
|||||||
this.$electron.ipcRenderer.on('clipboardFiles', (event, files) => {
|
this.$electron.ipcRenderer.on('clipboardFiles', (event, files) => {
|
||||||
this.clipboardFiles = files
|
this.clipboardFiles = files
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('uploadFiles', (event, files) => {
|
this.$electron.ipcRenderer.on('uploadFiles', (event) => {
|
||||||
files.forEach(item => {
|
|
||||||
this.$db.read().get('uploaded').insert(item).write()
|
|
||||||
})
|
|
||||||
this.files = this.$db.read().get('uploaded').slice().reverse().slice(0, 5).value()
|
this.files = this.$db.read().get('uploaded').slice().reverse().slice(0, 5).value()
|
||||||
})
|
})
|
||||||
this.$electron.ipcRenderer.on('updateFiles', (event) => {
|
this.$electron.ipcRenderer.on('updateFiles', (event) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user