2019-09-10 02:38:08 -04:00
|
|
|
// from v2.1.2
|
|
|
|
const updateShortKeyFromVersion212 = (db, shortKeyConfig) => {
|
|
|
|
let needUpgrade = false
|
2019-09-11 03:31:27 -04:00
|
|
|
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
|
|
|
}
|
2019-09-11 03:31:27 -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
|
|
|
|
}
|