diff options
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() { |