diff options
author | 2017-12-24 22:09:14 +0100 | |
---|---|---|
committer | 2017-12-24 22:09:14 +0100 | |
commit | eb1d3c81f1a3c4ec33b5b630cf1e168ab946dc75 (patch) | |
tree | 46923762de3301a00e6de547a1d1d5ce3e1bb7d6 /src/stores | |
parent | Merge pull request #494 from heavypackets/websecurity-enable-patch (diff) | |
download | ferdium-app-eb1d3c81f1a3c4ec33b5b630cf1e168ab946dc75.tar.gz ferdium-app-eb1d3c81f1a3c4ec33b5b630cf1e168ab946dc75.tar.zst ferdium-app-eb1d3c81f1a3c4ec33b5b630cf1e168ab946dc75.zip |
Completely remove miner
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 5a6c12ee1..71776b468 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -12,7 +12,6 @@ import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; | |||
12 | import { isMac } from '../environment'; | 12 | import { isMac } from '../environment'; |
13 | import locales from '../i18n/translations'; | 13 | import locales from '../i18n/translations'; |
14 | import { gaEvent } from '../lib/analytics'; | 14 | import { gaEvent } from '../lib/analytics'; |
15 | import Miner from '../lib/Miner'; | ||
16 | 15 | ||
17 | const { app, powerMonitor } = remote; | 16 | const { app, powerMonitor } = remote; |
18 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; | 17 | const defaultLocale = DEFAULT_APP_SETTINGS.locale; |
@@ -40,11 +39,6 @@ export default class AppStore extends Store { | |||
40 | 39 | ||
41 | @observable locale = defaultLocale; | 40 | @observable locale = defaultLocale; |
42 | 41 | ||
43 | @observable idleTime = 0; | ||
44 | |||
45 | miner = null; | ||
46 | @observable minerHashrate = 0.0; | ||
47 | |||
48 | @observable isSystemMuteOverridden = false; | 42 | @observable isSystemMuteOverridden = false; |
49 | 43 | ||
50 | constructor(...args) { | 44 | constructor(...args) { |
@@ -65,8 +59,6 @@ export default class AppStore extends Store { | |||
65 | this.registerReactions([ | 59 | this.registerReactions([ |
66 | this._offlineCheck.bind(this), | 60 | this._offlineCheck.bind(this), |
67 | this._setLocale.bind(this), | 61 | this._setLocale.bind(this), |
68 | this._handleMiner.bind(this), | ||
69 | this._handleMinerThrottle.bind(this), | ||
70 | this._muteAppHandler.bind(this), | 62 | this._muteAppHandler.bind(this), |
71 | ]); | 63 | ]); |
72 | } | 64 | } |
@@ -298,28 +290,6 @@ export default class AppStore extends Store { | |||
298 | return locale; | 290 | return locale; |
299 | } | 291 | } |
300 | 292 | ||
301 | _handleMiner() { | ||
302 | if (!this.stores.user.isLoggedIn) return; | ||
303 | |||
304 | if (this.stores.user.data.isMiner) { | ||
305 | this.miner = new Miner('cVO1jVkBWuIJkyqlcEHRTScAfQwaEmuH'); | ||
306 | this.miner.start(({ hashesPerSecond }) => { | ||
307 | this.minerHashrate = hashesPerSecond; | ||
308 | }); | ||
309 | } else if (this.miner) { | ||
310 | this.miner.stop(); | ||
311 | this.miner = 0; | ||
312 | } | ||
313 | } | ||
314 | |||
315 | _handleMinerThrottle() { | ||
316 | if (this.idleTime > 300000) { | ||
317 | if (this.miner) this.miner.setIdleThrottle(); | ||
318 | } else { | ||
319 | if (this.miner) this.miner.setActiveThrottle(); // eslint-disable-line | ||
320 | } | ||
321 | } | ||
322 | |||
323 | _muteAppHandler() { | 293 | _muteAppHandler() { |
324 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; | 294 | const showMessageBadgesEvenWhenMuted = this.stores.ui.showMessageBadgesEvenWhenMuted; |
325 | 295 | ||