Apply suggestions from code review

Co-authored-by: Edward Shen <eddie22099@gmail.com>
This commit is contained in:
Burnallover 2020-06-02 17:25:15 +02:00 committed by GitHub
parent fe72525d8c
commit f89c4d9e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ Module.register('MMM-pages', {
fixed: ['MMM-page-indicator'],
animationTime: 1000,
rotationTime: 0,
rotationFirstpage:0,
rotationFirstpage: 0,
rotationDelay: 10000
},
@ -53,7 +53,7 @@ Module.register('MMM-pages', {
// Disable rotation if an invalid input is given
this.config.rotationTime = Math.max(this.config.rotationTime, 0);
this.config.rotationDelay = Math.max(this.config.rotationDelay, 0);
this.config.rotationFirstpage = Math.max(this.config.rotationFirstpage, 0);
this.config.rotationFirstPage = Math.max(this.config.rotationFirstPage, 0);
},
/**
@ -214,7 +214,7 @@ Module.register('MMM-pages', {
self.updatePages();
}, self.config.rotationTime);
}, delay);
}if (this.config.rotationFirstpage > 0) {
} else if (this.config.rotationFirstPage > 0) {
// This timer is the auto rotate function.
clearInterval(this.timer);
// This is delay timer after manually updating.
@ -224,10 +224,10 @@ Module.register('MMM-pages', {
this.delayTimer = setTimeout(() => {
self.timer = setInterval(() => {
self.sendNotification('PAGE_CHANGED', 0);
self.changePageBy(-this.curPage);
self.curPage = 0;
self.updatePages();
}, self.config.rotationFirstpage);
}, self.config.rotationFirstPage);
}, delay);
}
}
},
});