From 3086aa902a74beb446e198ec2f4732967f74e418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCthe?= Date: Sat, 7 Nov 2020 16:53:53 +0100 Subject: [PATCH] reset parameter logic after renaming function --- MMM-pages.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MMM-pages.js b/MMM-pages.js index 6642f0c..8bedf92 100644 --- a/MMM-pages.js +++ b/MMM-pages.js @@ -118,23 +118,23 @@ Module.register('MMM-pages', { this.sendNotification('PAGE_NUMBER_IS', this.curPage); break; case 'PAUSE_ROTATION': - this.setRotation(true); + this.setRotation(false); break; case 'RESUME_ROTATION': - this.setRotation(false); + this.setRotation(true); break; case 'HOME_PAGE': this.notificationReceived('PAGE_CHANGED', this.config.homePage); break; case 'SHOW_HIDDEN_PAGE': 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); break; case 'LEAVE_HIDDEN_PAGE': Log.log("[Pages]: received a notification to leave the current hidden page "); this.animatePageChange(); - this.setRotation(false); + this.setRotation(true); break; default: // Do nothing } @@ -258,19 +258,19 @@ Module.register('MMM-pages', { /** * 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 * and do nothing. * * @param {boolean} isRotating the parameter, if you want to pause or resume. */ setRotation: function (isRotating) { - const stateBaseString = (isRotating) ? "paus" : "resum"; + const stateBaseString = (isRotating) ? "resum" : "paus"; if (isRotating === this.rotationPaused) { Log.warn(`[Pages]: Was asked to ${stateBaseString}e but rotation is already ${stateBaseString}ed!`); } else { Log.log(`[Pages]: ${stateBaseString}ing rotation`); - if (isRotating) { + if (!isRotating) { clearInterval(this.timer); clearInterval(this.delayTimer); } else {