Fix lint errors in VectorPushRulesDefinitions.js

Signed-off-by: Aaron Raimist <aaron@raim.ist>
pull/21833/head
Aaron Raimist 2018-10-11 21:59:17 -05:00
parent c83521bb31
commit 6d8649855a
No known key found for this signature in database
GPG Key ID: 37419210002890EF
1 changed files with 21 additions and 21 deletions

View File

@ -18,8 +18,8 @@ limitations under the License.
import { _td } from '../languageHandler';
var StandardActions = require('./StandardActions');
var PushRuleVectorState = require('./PushRuleVectorState');
const StandardActions = require('./StandardActions');
const PushRuleVectorState = require('./PushRuleVectorState');
class VectorPushRuleDefinition {
constructor(opts) {
@ -30,16 +30,16 @@ class VectorPushRuleDefinition {
// Translate the rule actions and its enabled value into vector state
ruleToVectorState(rule) {
var enabled = false;
var actions = null;
let enabled = false;
let actions = null;
if (rule) {
enabled = rule.enabled;
actions = rule.actions;
}
for (var stateKey in PushRuleVectorState.states) {
var state = PushRuleVectorState.states[stateKey];
var vectorStateToActions = this.vectorStateToActions[state];
for (const stateKey in PushRuleVectorState.states) {
const state = PushRuleVectorState.states[stateKey];
const vectorStateToActions = this.vectorStateToActions[state];
if (!vectorStateToActions) {
// No defined actions means that this vector state expects a disabled (or absent) rule
@ -58,7 +58,7 @@ class VectorPushRuleDefinition {
JSON.stringify(rule));
return undefined;
}
};
}
/**
* The descriptions of rules managed by the Vector UI.
@ -71,8 +71,8 @@ module.exports = {
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
off: StandardActions.ACTION_DISABLED
}
off: StandardActions.ACTION_DISABLED,
},
}),
// Messages containing user's username (localpart/MXID)
@ -82,8 +82,8 @@ module.exports = {
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
off: StandardActions.ACTION_DISABLED
}
off: StandardActions.ACTION_DISABLED,
},
}),
// Messages just sent to the user in a 1:1 room
@ -93,8 +93,8 @@ module.exports = {
vectorStateToActions: {
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
off: StandardActions.ACTION_DONT_NOTIFY
}
off: StandardActions.ACTION_DONT_NOTIFY,
},
}),
// Messages just sent to a group chat room
@ -106,8 +106,8 @@ module.exports = {
vectorStateToActions: {
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
off: StandardActions.ACTION_DONT_NOTIFY
}
off: StandardActions.ACTION_DONT_NOTIFY,
},
}),
// Invitation for the user
@ -117,8 +117,8 @@ module.exports = {
vectorStateToActions: {
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
off: StandardActions.ACTION_DISABLED
}
off: StandardActions.ACTION_DISABLED,
},
}),
// Incoming call
@ -128,8 +128,8 @@ module.exports = {
vectorStateToActions: {
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_NOTIFY_RING_SOUND,
off: StandardActions.ACTION_DISABLED
}
off: StandardActions.ACTION_DISABLED,
},
}),
// Notifications from bots
@ -141,6 +141,6 @@ module.exports = {
on: StandardActions.ACTION_DISABLED,
loud: StandardActions.ACTION_NOTIFY_DEFAULT_SOUND,
off: StandardActions.ACTION_DONT_NOTIFY,
}
},
}),
};