diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-11-17 14:16:26 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2017-11-17 14:16:26 +0100 |
commit | f53b4fda62a3ff62ff13988b306a126d4cbd8cfe (patch) | |
tree | 7f8cb06bf0f75a9d664252fb7930da5c21a2a67f /src/models | |
parent | streamline className (diff) | |
download | ferdium-app-f53b4fda62a3ff62ff13988b306a126d4cbd8cfe.tar.gz ferdium-app-f53b4fda62a3ff62ff13988b306a126d4cbd8cfe.tar.zst ferdium-app-f53b4fda62a3ff62ff13988b306a126d4cbd8cfe.zip |
remove webview from memory when disabled
Diffstat (limited to 'src/models')
-rw-r--r-- | src/models/Service.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/models/Service.js b/src/models/Service.js index dc53807f7..fc89f81b8 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 | ||
@@ -55,6 +55,14 @@ export default class Service { | |||
55 | ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; | 55 | ? data.isIndirectMessageBadgeEnabled : this.isIndirectMessageBadgeEnabled; |
56 | 56 | ||
57 | this.recipe = recipe; | 57 | this.recipe = recipe; |
58 | |||
59 | autorun(() => { | ||
60 | if (!this.isEnabled) { | ||
61 | this.webview = null; | ||
62 | this.unreadDirectMessageCount = 0; | ||
63 | this.unreadIndirectMessageCount = 0; | ||
64 | } | ||
65 | }); | ||
58 | } | 66 | } |
59 | 67 | ||
60 | @computed get url() { | 68 | @computed get url() { |