aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-08-22 21:40:07 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-08-22 21:40:07 +0200
commit30a891a83ce4bbbbaa6f6f3a13d2031b0a58188f (patch)
tree41dde64402f6a5ff93796ff5c541bf4dcf766542 /src/stores
parentRe-adding package-lock (diff)
downloadferdium-app-30a891a83ce4bbbbaa6f6f3a13d2031b0a58188f.tar.gz
ferdium-app-30a891a83ce4bbbbaa6f6f3a13d2031b0a58188f.tar.zst
ferdium-app-30a891a83ce4bbbbaa6f6f3a13d2031b0a58188f.zip
Fix eslint errors
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.js4
-rw-r--r--src/stores/RecipePreviewsStore.js2
-rw-r--r--src/stores/ServicesStore.js12
-rw-r--r--src/stores/UserStore.js4
4 files changed, 9 insertions, 13 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 2eae9ed0a..0311a11a3 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -1,6 +1,6 @@
1import { remote, ipcRenderer, shell } from 'electron'; 1import { remote, ipcRenderer, shell } from 'electron';
2import { 2import {
3 action, computed, observable, reaction, 3 action, computed, observable,
4} from 'mobx'; 4} from 'mobx';
5import moment from 'moment'; 5import moment from 'moment';
6import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 6import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
@@ -358,7 +358,7 @@ export default class AppStore extends Store {
358 } 358 }
359 359
360 _muteAppHandler() { 360 _muteAppHandler() {
361 const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; 361 const { showMessageBadgesEvenWhenMuted } = this.stores.ui;
362 362
363 if (!showMessageBadgesEvenWhenMuted) { 363 if (!showMessageBadgesEvenWhenMuted) {
364 this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 }); 364 this.actions.app.setBadge({ unreadDirectMessageCount: 0, unreadIndirectMessageCount: 0 });
diff --git a/src/stores/RecipePreviewsStore.js b/src/stores/RecipePreviewsStore.js
index a93aedfff..989e1124a 100644
--- a/src/stores/RecipePreviewsStore.js
+++ b/src/stores/RecipePreviewsStore.js
@@ -1,6 +1,4 @@
1import { action, computed, observable } from 'mobx'; 1import { action, computed, observable } from 'mobx';
2import { debounce } from 'lodash';
3import ms from 'ms';
4 2
5import Store from './lib/Store'; 3import Store from './lib/Store';
6import CachedRequest from './lib/CachedRequest'; 4import CachedRequest from './lib/CachedRequest';
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 4d98df851..6c6b7589f 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -4,7 +4,7 @@ import {
4 computed, 4 computed,
5 observable, 5 observable,
6} from 'mobx'; 6} from 'mobx';
7import { debounce, remove } from 'lodash'; 7import { remove } from 'lodash';
8import ms from 'ms'; 8import ms from 'ms';
9 9
10import Store from './lib/Store'; 10import Store from './lib/Store';
@@ -262,8 +262,6 @@ export default class ServicesStore extends Store {
262 remove(result, c => c.id === serviceId); 262 remove(result, c => c.id === serviceId);
263 }); 263 });
264 264
265 const service = this.one(serviceId);
266
267 await request._promise; 265 await request._promise;
268 this.actionStatus = request.result.status; 266 this.actionStatus = request.result.status;
269 } 267 }
@@ -385,7 +383,7 @@ export default class ServicesStore extends Store {
385 }, 383 },
386 }); 384 });
387 } else if (channel === 'notification') { 385 } else if (channel === 'notification') {
388 const options = args[0].options; 386 const { options } = args[0];
389 if (service.recipe.hasNotificationSound || service.isMuted || this.stores.settings.all.app.isAppMuted) { 387 if (service.recipe.hasNotificationSound || service.isMuted || this.stores.settings.all.app.isAppMuted) {
390 Object.assign(options, { 388 Object.assign(options, {
391 silent: true, 389 silent: true,
@@ -509,7 +507,7 @@ export default class ServicesStore extends Store {
509 } 507 }
510 508
511 @action _reorderService({ oldIndex, newIndex }) { 509 @action _reorderService({ oldIndex, newIndex }) {
512 const showDisabledServices = this.stores.settings.all.app.showDisabledServices; 510 const { showDisabledServices } = this.stores.settings.all.app;
513 const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); 511 const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]);
514 const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); 512 const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]);
515 513
@@ -603,8 +601,8 @@ export default class ServicesStore extends Store {
603 } 601 }
604 602
605 _getUnreadMessageCountReaction() { 603 _getUnreadMessageCountReaction() {
606 const showMessageBadgeWhenMuted = this.stores.settings.all.app.showMessageBadgeWhenMuted; 604 const { showMessageBadgeWhenMuted } = this.stores.settings.all.app;
607 const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; 605 const { showMessageBadgesEvenWhenMuted } = this.stores.ui;
608 606
609 const unreadDirectMessageCount = this.allDisplayed 607 const unreadDirectMessageCount = this.allDisplayed
610 .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled) 608 .filter(s => (showMessageBadgeWhenMuted || s.isNotificationEnabled) && showMessageBadgesEvenWhenMuted && s.isBadgeEnabled)
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js
index bd451661a..d813e97b1 100644
--- a/src/stores/UserStore.js
+++ b/src/stores/UserStore.js
@@ -232,12 +232,12 @@ export default class UserStore extends Store {
232 const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id); 232 const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id);
233 233
234 // Install recipes 234 // Install recipes
235 for (const recipe of recipes) { 235 for (const recipe of recipes) { // eslint-disable-line no-unused-vars
236 // eslint-disable-next-line 236 // eslint-disable-next-line
237 await this.stores.recipes._install({ recipeId: recipe }); 237 await this.stores.recipes._install({ recipeId: recipe });
238 } 238 }
239 239
240 for (const service of services) { 240 for (const service of services) { // eslint-disable-line no-unused-vars
241 this.actions.service.createFromLegacyService({ 241 this.actions.service.createFromLegacyService({
242 data: service, 242 data: service,
243 }); 243 });