aboutsummaryrefslogtreecommitdiffstats
path: root/src/models
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2017-11-18 22:34:46 +0100
committerLibravatar GitHub <noreply@github.com>2017-11-18 22:34:46 +0100
commit3da65653c4f6866f048d60f87c20217376679bc6 (patch)
tree9b3495674c4381feaf5f35e92de97a1b54d9b08e /src/models
parentFix typos (diff)
parentallow service to be reattached properly after re-enabling service (diff)
downloadferdium-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.js11
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 @@
1import { computed, observable } from 'mobx'; 1import { computed, observable, autorun } from 'mobx';
2import path from 'path'; 2import path from 'path';
3import normalizeUrl from 'normalize-url'; 3import 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() {