diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-11-18 22:34:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-18 22:34:46 +0100 |
commit | 3da65653c4f6866f048d60f87c20217376679bc6 (patch) | |
tree | 9b3495674c4381feaf5f35e92de97a1b54d9b08e /src/models | |
parent | Fix typos (diff) | |
parent | allow service to be reattached properly after re-enabling service (diff) | |
download | ferdium-app-3da65653c4f6866f048d60f87c20217376679bc6.tar.gz ferdium-app-3da65653c4f6866f048d60f87c20217376679bc6.tar.zst ferdium-app-3da65653c4f6866f048d60f87c20217376679bc6.zip |
Merge pull request #294 from meetfranz/feature/192-display-disabled-services
[PR] Disable/Enable service optimizations
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/Service.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index eb68493fe..d0985969b 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -1,4 +1,4 @@ | |||
1 | import { computed, observable } from 'mobx'; | 1 | import { computed, observable, autorun } from 'mobx'; |
2 | import path from 'path'; | 2 | import path from 'path'; |
3 | import normalizeUrl from 'normalize-url'; | 3 | import normalizeUrl from 'normalize-url'; |
4 | 4 | ||
@@ -58,6 +58,15 @@ export default class Service { | |||
58 | this.isMuted = data.isMuted !== undefined ? data.isMuted : this.isMuted; | 58 | this.isMuted = data.isMuted !== undefined ? data.isMuted : this.isMuted; |
59 | 59 | ||
60 | this.recipe = recipe; | 60 | this.recipe = recipe; |
61 | |||
62 | autorun(() => { | ||
63 | if (!this.isEnabled) { | ||
64 | this.webview = null; | ||
65 | this.isAttached = false; | ||
66 | this.unreadDirectMessageCount = 0; | ||
67 | this.unreadIndirectMessageCount = 0; | ||
68 | } | ||
69 | }); | ||
61 | } | 70 | } |
62 | 71 | ||
63 | @computed get url() { | 72 | @computed get url() { |