Fix lint errors in NotificationUtils.js
Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
parent
6b5650dbb1
commit
fb1deee387
1 changed files with 11 additions and 11 deletions
|
@ -24,11 +24,11 @@ module.exports = {
|
||||||
// }
|
// }
|
||||||
// to a list of push actions.
|
// to a list of push actions.
|
||||||
encodeActions: function(action) {
|
encodeActions: function(action) {
|
||||||
var notify = action.notify;
|
const notify = action.notify;
|
||||||
var sound = action.sound;
|
const sound = action.sound;
|
||||||
var highlight = action.highlight;
|
const highlight = action.highlight;
|
||||||
if (notify) {
|
if (notify) {
|
||||||
var actions = ["notify"];
|
const actions = ["notify"];
|
||||||
if (sound) {
|
if (sound) {
|
||||||
actions.push({"set_tweak": "sound", "value": sound});
|
actions.push({"set_tweak": "sound", "value": sound});
|
||||||
}
|
}
|
||||||
|
@ -50,19 +50,19 @@ module.exports = {
|
||||||
// }
|
// }
|
||||||
// If the actions couldn't be decoded then returns null.
|
// If the actions couldn't be decoded then returns null.
|
||||||
decodeActions: function(actions) {
|
decodeActions: function(actions) {
|
||||||
var notify = false;
|
let notify = false;
|
||||||
var sound = null;
|
let sound = null;
|
||||||
var highlight = false;
|
let highlight = false;
|
||||||
|
|
||||||
for (var i = 0; i < actions.length; ++i) {
|
for (let i = 0; i < actions.length; ++i) {
|
||||||
var action = actions[i];
|
const action = actions[i];
|
||||||
if (action === "notify") {
|
if (action === "notify") {
|
||||||
notify = true;
|
notify = true;
|
||||||
} else if (action === "dont_notify") {
|
} else if (action === "dont_notify") {
|
||||||
notify = false;
|
notify = false;
|
||||||
} else if (typeof action === 'object') {
|
} else if (typeof action === 'object') {
|
||||||
if (action.set_tweak === "sound") {
|
if (action.set_tweak === "sound") {
|
||||||
sound = action.value
|
sound = action.value;
|
||||||
} else if (action.set_tweak === "highlight") {
|
} else if (action.set_tweak === "highlight") {
|
||||||
highlight = action.value;
|
highlight = action.value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -80,7 +80,7 @@ module.exports = {
|
||||||
highlight = true;
|
highlight = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = {notify: notify, highlight: highlight};
|
const result = {notify: notify, highlight: highlight};
|
||||||
if (sound !== null) {
|
if (sound !== null) {
|
||||||
result.sound = sound;
|
result.sound = sound;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue