tweak mascot code

This commit is contained in:
Thibault Duplessis 2017-08-19 21:35:50 -05:00
parent ea6e480239
commit 44724e38f2

View file

@ -12,8 +12,7 @@ export default class Mascot {
current = this.storage.get() || this.list[0];
switch = () => {
const newIndex = this.list.indexOf(this.current) + 1;
this.current = this.list[newIndex % this.list.length];
this.current = this.list[(this.list.indexOf(this.current) + 1) % this.list.length];
this.storage.set(this.current);
}