diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c460fc..2687345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [2.3.4] - Unreleased + +### Fixed +- Classes now detects when you're using identifiers and names in the same action (#259) + ## [2.3.3] - 2021-04-05 ### Changed diff --git a/MMM-Remote-Control.js b/MMM-Remote-Control.js index cf783da..e5f4e64 100644 --- a/MMM-Remote-Control.js +++ b/MMM-Remote-Control.js @@ -131,22 +131,17 @@ Module.register("MMM-Remote-Control", { if (payload.force) { options.force = true; } let modules = [] if(payload.module !== 'all') { - if (!Array.prototype.find) { - // https://tc39.github.io/ecma262/#sec-array.prototype.find - Object.defineProperty(Array.prototype,"find",{value:function(r){if(null==this)throw new TypeError('"this" is null or not defined');var e=Object(this),t=e.length>>>0;if("function"!=typeof r)throw new TypeError("predicate must be a function");for(var n=arguments[1],i=0;i { - if(m) { - return (payload.module.includes(m.identifier)); - } - }); - if (!i) { - modules = MM.getModules().filter(m => { - if(m) { - return (payload.module.includes(m.name)); - } - }); - } else modules.push(i) + let x = payload.module + modules = modules.concat(MM.getModules().filter(m => { + if(m && x.includes(m.identifier)) { + x = x.filter((t)=>t!=m.identifier) + return true; + } + }),MM.getModules().filter(m => { + if(m) { + return x.includes(m.name); + } + })) } else { modules = MM.getModules() } diff --git a/package.json b/package.json index eaf034e..8cd07bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Magic-Mirror-Module-Remote-Control", - "version": "2.3.2", + "version": "2.3.4", "description": "This module for the Magic Mirror allows you to shutdown and configure your mirror through a web browser.", "repository": { "type": "git",