reset parameter logic after renaming function

This commit is contained in:
Sebastian Küthe 2020-11-07 16:53:53 +01:00
parent 72ebd17d62
commit 3086aa902a

View file

@ -118,23 +118,23 @@ Module.register('MMM-pages', {
this.sendNotification('PAGE_NUMBER_IS', this.curPage); this.sendNotification('PAGE_NUMBER_IS', this.curPage);
break; break;
case 'PAUSE_ROTATION': case 'PAUSE_ROTATION':
this.setRotation(true); this.setRotation(false);
break; break;
case 'RESUME_ROTATION': case 'RESUME_ROTATION':
this.setRotation(false); this.setRotation(true);
break; break;
case 'HOME_PAGE': case 'HOME_PAGE':
this.notificationReceived('PAGE_CHANGED', this.config.homePage); this.notificationReceived('PAGE_CHANGED', this.config.homePage);
break; break;
case 'SHOW_HIDDEN_PAGE': case 'SHOW_HIDDEN_PAGE':
Log.log(`[Pages]: received a notification to change to the hidden page "${payload}" of type "${typeof payload}"`); Log.log(`[Pages]: received a notification to change to the hidden page "${payload}" of type "${typeof payload}"`);
this.setRotation(true); this.setRotation(false);
this.showHiddenPage(payload); this.showHiddenPage(payload);
break; break;
case 'LEAVE_HIDDEN_PAGE': case 'LEAVE_HIDDEN_PAGE':
Log.log("[Pages]: received a notification to leave the current hidden page "); Log.log("[Pages]: received a notification to leave the current hidden page ");
this.animatePageChange(); this.animatePageChange();
this.setRotation(false); this.setRotation(true);
break; break;
default: // Do nothing default: // Do nothing
} }
@ -258,19 +258,19 @@ Module.register('MMM-pages', {
/** /**
* Pause or resume the page rotation. If the provided isRotating value is * Pause or resume the page rotation. If the provided isRotating value is
* set to false, it will resume the rotation. If the requested * set to true, it will resume the rotation. If the requested
* state (f.e. isRotating === true) equals the current state, print a warning * state (f.e. isRotating === true) equals the current state, print a warning
* and do nothing. * and do nothing.
* *
* @param {boolean} isRotating the parameter, if you want to pause or resume. * @param {boolean} isRotating the parameter, if you want to pause or resume.
*/ */
setRotation: function (isRotating) { setRotation: function (isRotating) {
const stateBaseString = (isRotating) ? "paus" : "resum"; const stateBaseString = (isRotating) ? "resum" : "paus";
if (isRotating === this.rotationPaused) { if (isRotating === this.rotationPaused) {
Log.warn(`[Pages]: Was asked to ${stateBaseString}e but rotation is already ${stateBaseString}ed!`); Log.warn(`[Pages]: Was asked to ${stateBaseString}e but rotation is already ${stateBaseString}ed!`);
} else { } else {
Log.log(`[Pages]: ${stateBaseString}ing rotation`); Log.log(`[Pages]: ${stateBaseString}ing rotation`);
if (isRotating) { if (!isRotating) {
clearInterval(this.timer); clearInterval(this.timer);
clearInterval(this.delayTimer); clearInterval(this.delayTimer);
} else { } else {