diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-02-26 15:38:20 +0100 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-02-26 15:38:20 +0100 |
commit | b5ad31e316c1074cfa6f57f83e262a607eda9d44 (patch) | |
tree | affcfbc28b8892388ab23d97415902edfc682cab /src/stores | |
parent | finish basic workspace settings (diff) | |
parent | remove unused packages (diff) | |
download | ferdium-app-b5ad31e316c1074cfa6f57f83e262a607eda9d44.tar.gz ferdium-app-b5ad31e316c1074cfa6f57f83e262a607eda9d44.tar.zst ferdium-app-b5ad31e316c1074cfa6f57f83e262a607eda9d44.zip |
fixes merge conflicts with latest develop
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 7 | ||||
-rw-r--r-- | src/stores/FeaturesStore.js | 2 | ||||
-rw-r--r-- | src/stores/RecipePreviewsStore.js | 3 | ||||
-rw-r--r-- | src/stores/RequestStore.js | 3 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 5 |
5 files changed, 13 insertions, 7 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index d90f32744..168aa7e48 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -7,6 +7,7 @@ import key from 'keymaster'; | |||
7 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | 7 | import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; |
8 | import AutoLaunch from 'auto-launch'; | 8 | import AutoLaunch from 'auto-launch'; |
9 | import prettyBytes from 'pretty-bytes'; | 9 | import prettyBytes from 'pretty-bytes'; |
10 | import ms from 'ms'; | ||
10 | 11 | ||
11 | import Store from './lib/Store'; | 12 | import Store from './lib/Store'; |
12 | import Request from './lib/Request'; | 13 | import Request from './lib/Request'; |
@@ -112,12 +113,12 @@ export default class AppStore extends Store { | |||
112 | // Check if system is muted | 113 | // Check if system is muted |
113 | // There are no events to subscribe so we need to poll everey 5s | 114 | // There are no events to subscribe so we need to poll everey 5s |
114 | this._systemDND(); | 115 | this._systemDND(); |
115 | setInterval(() => this._systemDND(), 5000); | 116 | setInterval(() => this._systemDND(), ms('5s')); |
116 | 117 | ||
117 | // Check for updates once every 4 hours | 118 | // Check for updates once every 4 hours |
118 | setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); | 119 | setInterval(() => this._checkForUpdates(), CHECK_INTERVAL); |
119 | // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) | 120 | // Check for an update in 30s (need a delay to prevent Squirrel Installer lock file issues) |
120 | setTimeout(() => this._checkForUpdates(), 30000); | 121 | setTimeout(() => this._checkForUpdates(), ms('30s')); |
121 | ipcRenderer.on('autoUpdate', (event, data) => { | 122 | ipcRenderer.on('autoUpdate', (event, data) => { |
122 | if (data.available) { | 123 | if (data.available) { |
123 | this.updateStatus = this.updateStatusTypes.AVAILABLE; | 124 | this.updateStatus = this.updateStatusTypes.AVAILABLE; |
@@ -316,7 +317,7 @@ export default class AppStore extends Store { | |||
316 | } else { | 317 | } else { |
317 | const deltaTime = moment().diff(this.timeOfflineStart); | 318 | const deltaTime = moment().diff(this.timeOfflineStart); |
318 | 319 | ||
319 | if (deltaTime > 30 * 60 * 1000) { | 320 | if (deltaTime > ms('30m')) { |
320 | this.actions.service.reloadAll(); | 321 | this.actions.service.reloadAll(); |
321 | } | 322 | } |
322 | } | 323 | } |
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js index 05a620f0b..b7130904b 100644 --- a/src/stores/FeaturesStore.js +++ b/src/stores/FeaturesStore.js | |||
@@ -8,6 +8,7 @@ import spellchecker from '../features/spellchecker'; | |||
8 | import serviceProxy from '../features/serviceProxy'; | 8 | import serviceProxy from '../features/serviceProxy'; |
9 | import basicAuth from '../features/basicAuth'; | 9 | import basicAuth from '../features/basicAuth'; |
10 | import workspaces from '../features/workspaces'; | 10 | import workspaces from '../features/workspaces'; |
11 | import shareFranz from '../features/shareFranz'; | ||
11 | 12 | ||
12 | import { DEFAULT_FEATURES_CONFIG } from '../config'; | 13 | import { DEFAULT_FEATURES_CONFIG } from '../config'; |
13 | 14 | ||
@@ -58,5 +59,6 @@ export default class FeaturesStore extends Store { | |||
58 | serviceProxy(this.stores, this.actions); | 59 | serviceProxy(this.stores, this.actions); |
59 | basicAuth(this.stores, this.actions); | 60 | basicAuth(this.stores, this.actions); |
60 | workspaces(this.stores, this.actions); | 61 | workspaces(this.stores, this.actions); |
62 | shareFranz(this.stores, this.actions); | ||
61 | } | 63 | } |
62 | } | 64 | } |
diff --git a/src/stores/RecipePreviewsStore.js b/src/stores/RecipePreviewsStore.js index 10b2928e3..382820d58 100644 --- a/src/stores/RecipePreviewsStore.js +++ b/src/stores/RecipePreviewsStore.js | |||
@@ -1,5 +1,6 @@ | |||
1 | import { action, computed, observable } from 'mobx'; | 1 | import { action, computed, observable } from 'mobx'; |
2 | import { debounce } from 'lodash'; | 2 | import { debounce } from 'lodash'; |
3 | import ms from 'ms'; | ||
3 | 4 | ||
4 | import Store from './lib/Store'; | 5 | import Store from './lib/Store'; |
5 | import CachedRequest from './lib/CachedRequest'; | 6 | import CachedRequest from './lib/CachedRequest'; |
@@ -48,5 +49,5 @@ export default class RecipePreviewsStore extends Store { | |||
48 | // Helper | 49 | // Helper |
49 | _analyticsSearch = debounce((needle) => { | 50 | _analyticsSearch = debounce((needle) => { |
50 | gaEvent('Recipe', 'search', needle); | 51 | gaEvent('Recipe', 'search', needle); |
51 | }, 3000); | 52 | }, ms('3s')); |
52 | } | 53 | } |
diff --git a/src/stores/RequestStore.js b/src/stores/RequestStore.js index 2629e0a38..9254e3223 100644 --- a/src/stores/RequestStore.js +++ b/src/stores/RequestStore.js | |||
@@ -1,4 +1,5 @@ | |||
1 | import { action, computed, observable } from 'mobx'; | 1 | import { action, computed, observable } from 'mobx'; |
2 | import ms from 'ms'; | ||
2 | 3 | ||
3 | import Store from './lib/Store'; | 4 | import Store from './lib/Store'; |
4 | 5 | ||
@@ -13,7 +14,7 @@ export default class RequestStore extends Store { | |||
13 | 14 | ||
14 | retries = 0; | 15 | retries = 0; |
15 | 16 | ||
16 | retryDelay = 2000; | 17 | retryDelay = ms('2s'); |
17 | 18 | ||
18 | constructor(...args) { | 19 | constructor(...args) { |
19 | super(...args); | 20 | super(...args); |
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index efd57a09d..c63bef196 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -5,6 +5,7 @@ import { | |||
5 | observable, | 5 | observable, |
6 | } from 'mobx'; | 6 | } from 'mobx'; |
7 | import { debounce, remove } from 'lodash'; | 7 | import { debounce, remove } from 'lodash'; |
8 | import ms from 'ms'; | ||
8 | 9 | ||
9 | import Store from './lib/Store'; | 10 | import Store from './lib/Store'; |
10 | import Request from './lib/Request'; | 11 | import Request from './lib/Request'; |
@@ -679,7 +680,7 @@ export default class ServicesStore extends Store { | |||
679 | _initRecipePolling(serviceId) { | 680 | _initRecipePolling(serviceId) { |
680 | const service = this.one(serviceId); | 681 | const service = this.one(serviceId); |
681 | 682 | ||
682 | const delay = 2000; | 683 | const delay = ms('2s'); |
683 | 684 | ||
684 | if (service) { | 685 | if (service) { |
685 | if (service.timer !== null) { | 686 | if (service.timer !== null) { |
@@ -700,7 +701,7 @@ export default class ServicesStore extends Store { | |||
700 | 701 | ||
701 | _reorderAnalytics = debounce(() => { | 702 | _reorderAnalytics = debounce(() => { |
702 | gaEvent('Service', 'order'); | 703 | gaEvent('Service', 'order'); |
703 | }, 5000); | 704 | }, ms('5s')); |
704 | 705 | ||
705 | _wrapIndex(index, delta, size) { | 706 | _wrapIndex(index, delta, size) { |
706 | return (((index + delta) % size) + size) % size; | 707 | return (((index + delta) % size) + size) % size; |