Fixed: image-size bug && change config all to settings

This commit is contained in:
Molunerfinn
2018-09-27 17:22:14 +08:00
parent 804072999e
commit 5909d35566
11 changed files with 81 additions and 63 deletions

View File

@@ -65,7 +65,8 @@ export default (app, ipcMain) => {
config: handleConfigWithFunction(getConfig(uploaderName, 'transformer', picgo))
}
},
enabled: picgo.getConfig(`plugins.${pluginList[i]}`)
enabled: picgo.getConfig(`plugins.${pluginList[i]}`),
pkg: pluginPKG
}
list.push(obj)
}

View File

@@ -7,9 +7,9 @@ const release = 'https://api.github.com/repos/Molunerfinn/PicGo/releases/latest'
const downloadUrl = 'https://github.com/Molunerfinn/PicGo/releases/latest'
const checkVersion = async () => {
let showTip = db.read().get('picBed.showUpdateTip').value()
let showTip = db.read().get('settings.showUpdateTip').value()
if (showTip === undefined) {
db.read().set('picBed.showUpdateTip', true).write()
db.read().set('settings.showUpdateTip', true).write()
showTip = true
}
if (showTip) {
@@ -29,7 +29,7 @@ const checkVersion = async () => {
if (res === 0) { // if selected yes
shell.openExternal(downloadUrl)
}
db.read().set('picBed.showUpdateTip', !checkboxChecked).write()
db.read().set('settings.showUpdateTip', !checkboxChecked).write()
})
}
} else {

View File

@@ -85,8 +85,8 @@ const uploader = (img, type, webContents) => {
picgo.helper.beforeUploadPlugins.register('renameFn', {
handle: async ctx => {
const rename = picgo.getConfig('picBed.rename')
const autoRename = picgo.getConfig('picBed.autoRename')
const rename = picgo.getConfig('settings.rename')
const autoRename = picgo.getConfig('settings.autoRename')
await Promise.all(ctx.output.map(async item => {
let name
let fileName
@@ -102,13 +102,12 @@ const uploader = (img, type, webContents) => {
name = await waitForRename(window, window.webContents.id)
}
item.fileName = name || fileName
console.log(item)
}))
}
})
picgo.on('beforeTransform', ctx => {
if (ctx.getConfig('picBed.uploadNotification')) {
if (ctx.getConfig('settings.uploadNotification')) {
const notification = new Notification({
title: '上传进度',
body: '正在上传'