From 30a891a83ce4bbbbaa6f6f3a13d2031b0a58188f Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 22 Aug 2019 21:40:07 +0200 Subject: Fix eslint errors --- src/stores/AppStore.js | 4 ++-- src/stores/RecipePreviewsStore.js | 2 -- src/stores/ServicesStore.js | 12 +++++------- src/stores/UserStore.js | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) (limited to 'src/stores') 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 @@ import { remote, ipcRenderer, shell } from 'electron'; import { - action, computed, observable, reaction, + action, computed, observable, } from 'mobx'; import moment from 'moment'; import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; @@ -358,7 +358,7 @@ export default class AppStore extends Store { } _muteAppHandler() { - const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; + const { showMessageBadgesEvenWhenMuted } = this.stores.ui; if (!showMessageBadgesEvenWhenMuted) { 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 @@ import { action, computed, observable } from 'mobx'; -import { debounce } from 'lodash'; -import ms from 'ms'; import Store from './lib/Store'; import 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 { computed, observable, } from 'mobx'; -import { debounce, remove } from 'lodash'; +import { remove } from 'lodash'; import ms from 'ms'; import Store from './lib/Store'; @@ -262,8 +262,6 @@ export default class ServicesStore extends Store { remove(result, c => c.id === serviceId); }); - const service = this.one(serviceId); - await request._promise; this.actionStatus = request.result.status; } @@ -385,7 +383,7 @@ export default class ServicesStore extends Store { }, }); } else if (channel === 'notification') { - const options = args[0].options; + const { options } = args[0]; if (service.recipe.hasNotificationSound || service.isMuted || this.stores.settings.all.app.isAppMuted) { Object.assign(options, { silent: true, @@ -509,7 +507,7 @@ export default class ServicesStore extends Store { } @action _reorderService({ oldIndex, newIndex }) { - const showDisabledServices = this.stores.settings.all.app.showDisabledServices; + const { showDisabledServices } = this.stores.settings.all.app; const oldEnabledSortIndex = showDisabledServices ? oldIndex : this.all.indexOf(this.enabled[oldIndex]); const newEnabledSortIndex = showDisabledServices ? newIndex : this.all.indexOf(this.enabled[newIndex]); @@ -603,8 +601,8 @@ export default class ServicesStore extends Store { } _getUnreadMessageCountReaction() { - const showMessageBadgeWhenMuted = this.stores.settings.all.app.showMessageBadgeWhenMuted; - const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; + const { showMessageBadgeWhenMuted } = this.stores.settings.all.app; + const { showMessageBadgesEvenWhenMuted } = this.stores.ui; const unreadDirectMessageCount = this.allDisplayed .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 { const recipes = services.filter((obj, pos, arr) => arr.map(mapObj => mapObj.recipe.id).indexOf(obj.recipe.id) === pos).map(s => s.recipe.id); // Install recipes - for (const recipe of recipes) { + for (const recipe of recipes) { // eslint-disable-line no-unused-vars // eslint-disable-next-line await this.stores.recipes._install({ recipeId: recipe }); } - for (const service of services) { + for (const service of services) { // eslint-disable-line no-unused-vars this.actions.service.createFromLegacyService({ data: service, }); -- cgit v1.2.3-70-g09d2