PicList/src/main/migrate/shortKeyUpdateHelper.js

25 lines
522 B
JavaScript
Raw Normal View History

2019-09-10 02:38:08 -04:00
// from v2.1.2
const updateShortKeyFromVersion212 = (db, shortKeyConfig) => {
let needUpgrade = false
if (shortKeyConfig.upload) {
needUpgrade = true
shortKeyConfig['picgo:upload'] = {
enable: true,
key: shortKeyConfig.upload,
name: 'picgo:upload',
label: '快捷上传'
2019-09-10 02:38:08 -04:00
}
delete shortKeyConfig.upload
}
2019-09-10 02:38:08 -04:00
if (needUpgrade) {
2019-09-11 07:30:08 -04:00
db.set('settings.shortKey', shortKeyConfig)
2019-09-10 02:38:08 -04:00
return shortKeyConfig
} else {
return false
}
}
export {
updateShortKeyFromVersion212
}