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