fix(webreader): cycle image fit would not persist setting

This commit is contained in:
Gauthier Roebroeck 2020-07-30 20:18:30 +08:00
parent 2db64e8f0d
commit e5272d2243

View File

@ -671,10 +671,10 @@ export default Vue.extend({
this.sendNotification(`Changing Reading Direction to: ${text}`)
},
cycleScale () {
let fit: ImageFit = this.settings.fit
let i = (this.settings.imageFits.indexOf(fit) + 1) % (this.settings.imageFits.length)
this.settings.fit = this.settings.imageFits[i]
let text = this.imageFits[i].text
const fit: ImageFit = this.settings.fit
const i = (this.settings.imageFits.indexOf(fit) + 1) % (this.settings.imageFits.length)
this.imageFit = this.settings.imageFits[i]
const text = this.imageFits[i].text
// The text here only works cause this.imageFits has the same index structure as the ImageFit enum
this.sendNotification(`Cycling Scale: ${text}`)
},