mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-14 20:08:48 +08:00
🔨 Refactor: db class
This commit is contained in:
@@ -60,7 +60,7 @@ class GuiApi {
|
||||
async upload (input) {
|
||||
const imgs = await new Uploader(input, this[WEBCONTENTS], this[PICGO]).upload()
|
||||
if (imgs !== false) {
|
||||
const pasteStyle = db.read().get('settings.pasteStyle').value() || 'markdown'
|
||||
const pasteStyle = db.get('settings.pasteStyle') || 'markdown'
|
||||
let pasteText = ''
|
||||
for (let i in imgs) {
|
||||
pasteText += pasteTemplate(pasteStyle, imgs[i]) + '\r\n'
|
||||
@@ -72,7 +72,7 @@ class GuiApi {
|
||||
setTimeout(() => {
|
||||
notification.show()
|
||||
}, i * 100)
|
||||
db.read().get('uploaded').insert(imgs[i]).write()
|
||||
db.insert('uploaded', imgs[i])
|
||||
}
|
||||
clipboard.writeText(pasteText)
|
||||
this[WEBCONTENTS].send('uploadFiles', imgs)
|
||||
|
||||
Reference in New Issue
Block a user