Fixed: transformer value

This commit is contained in:
PiEgg 2019-01-02 22:56:26 +08:00
parent 78d0baef7d
commit 5e5a5f133a

View File

@ -237,7 +237,7 @@ export default {
// handle transformer // handle transformer
if (plugin.config.transformer.name) { if (plugin.config.transformer.name) {
let currentTransformer = this.$db.read().get('picBed.transformer') || 'path' let currentTransformer = this.$db.read().get('picBed.transformer').value() || 'path'
let pluginTransformer = plugin.config.transformer.name let pluginTransformer = plugin.config.transformer.name
const obj = { const obj = {
label: `${currentTransformer === pluginTransformer ? '禁用' : '启用'}transformer - ${plugin.config.transformer.name}`, label: `${currentTransformer === pluginTransformer ? '禁用' : '启用'}transformer - ${plugin.config.transformer.name}`,
@ -294,7 +294,7 @@ export default {
this.searchText = '' this.searchText = ''
}, },
toggleTransformer (transformer) { toggleTransformer (transformer) {
let currentTransformer = this.$db.read().get('picBed.transformer') || 'path' let currentTransformer = this.$db.read().get('picBed.transformer').value() || 'path'
if (currentTransformer === transformer) { if (currentTransformer === transformer) {
this.$db.read().set('picBed.transformer', 'path').write() this.$db.read().set('picBed.transformer', 'path').write()
} else { } else {
@ -357,7 +357,6 @@ export default {
handleRestoreState (item, name) { handleRestoreState (item, name) {
if (item === 'uploader') { if (item === 'uploader') {
const current = this.$db.read().get('picBed.current').value() const current = this.$db.read().get('picBed.current').value()
console.log(name)
if (current === name) { if (current === name) {
this.$db.read().set('picBed.current', 'smms').write() this.$db.read().set('picBed.current', 'smms').write()
} }