signal-desktop/js/models/blockedNumbers.js
Scott Nonnenberg 43a44793c5 Remove jshint - move everything over to eslint
Also removed all hints of previous linters
2018-07-17 15:54:32 -07:00

30 lines
758 B
JavaScript

/* global storage, _ */
// eslint-disable-next-line func-names
(function() {
'use strict';
storage.isBlocked = number => {
const numbers = storage.get('blocked', []);
return _.include(numbers, number);
};
storage.addBlockedNumber = number => {
const numbers = storage.get('blocked', []);
if (_.include(numbers, number)) {
return;
}
console.log('adding', number, 'to blocked list');
storage.put('blocked', numbers.concat(number));
};
storage.removeBlockedNumber = number => {
const numbers = storage.get('blocked', []);
if (!_.include(numbers, number)) {
return;
}
console.log('removing', number, 'from blocked list');
storage.put('blocked', _.without(numbers, number));
};
})();