From 3fb0fafbd96d893ccacaac8528eea586f2fe3eab Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Mon, 29 Apr 2019 11:17:48 +0200 Subject: [PATCH] Filter statusChanged for notification --- src/app/components/local-plugin.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/components/local-plugin.js b/src/app/components/local-plugin.js index 67f6df8135..2bac1cde30 100644 --- a/src/app/components/local-plugin.js +++ b/src/app/components/local-plugin.js @@ -2,6 +2,8 @@ const yo = require('yo-yo') const modalDialog = require('../ui/modaldialog') +const unexposedEvents = ['statusChanged'] + module.exports = class LocalPlugin { /** @@ -39,10 +41,10 @@ module.exports = class LocalPlugin { hash: `local-${this.profile.name}`, location: 'swapPanel' } - if (!this.profile.name) throw new Error('Plugin should have a name') - if (!this.profile.url) throw new Error('Plugin should have an URL') + if (!profile.name) throw new Error('Plugin should have a name') + if (!profile.url) throw new Error('Plugin should have an URL') localStorage.setItem('plugins/local', JSON.stringify(profile)) - return this.profile + return profile } /** @@ -118,9 +120,12 @@ module.exports = class LocalPlugin {
${profiles.map(({name, events}) => { - return events.map(event => this.notificationCheckbox(name, event)) + return events + .filter(event => !unexposedEvents.includes(event)) + .map(event => this.notificationCheckbox(name, event)) })}
` } } +