Fix lint errors in PushRuleVectorState.js

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2018-10-11 22:01:10 -05:00
parent 6d8649855a
commit 6b5650dbb1
No known key found for this signature in database
GPG key ID: 37419210002890EF

View file

@ -16,10 +16,10 @@ limitations under the License.
'use strict'; 'use strict';
var StandardActions = require('./StandardActions'); const StandardActions = require('./StandardActions');
var NotificationUtils = require('./NotificationUtils'); const NotificationUtils = require('./NotificationUtils');
var states = { const states = {
/** The push rule is disabled */ /** The push rule is disabled */
OFF: "off", OFF: "off",
@ -48,8 +48,7 @@ module.exports = {
actionsFor: function(pushRuleVectorState) { actionsFor: function(pushRuleVectorState) {
if (pushRuleVectorState === this.ON) { if (pushRuleVectorState === this.ON) {
return StandardActions.ACTION_NOTIFY; return StandardActions.ACTION_NOTIFY;
} } else if (pushRuleVectorState === this.LOUD) {
else if (pushRuleVectorState === this.LOUD) {
return StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND; return StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND;
} }
}, },
@ -62,21 +61,21 @@ module.exports = {
* state. Returns null if it does not match these categories. * state. Returns null if it does not match these categories.
*/ */
contentRuleVectorStateKind: function(rule) { contentRuleVectorStateKind: function(rule) {
var decoded = NotificationUtils.decodeActions(rule.actions); const decoded = NotificationUtils.decodeActions(rule.actions);
if (!decoded) { if (!decoded) {
return null; return null;
} }
// Count tweaks to determine if it is a ON or LOUD rule // Count tweaks to determine if it is a ON or LOUD rule
var tweaks = 0; let tweaks = 0;
if (decoded.sound) { if (decoded.sound) {
tweaks++; tweaks++;
} }
if (decoded.highlight) { if (decoded.highlight) {
tweaks++; tweaks++;
} }
var stateKind = null; let stateKind = null;
switch (tweaks) { switch (tweaks) {
case 0: case 0:
stateKind = this.ON; stateKind = this.ON;
@ -89,6 +88,6 @@ module.exports = {
}, },
}; };
for (var k in states) { for (const k in states) {
module.exports[k] = states[k]; module.exports[k] = states[k];
}; }