aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/FeaturesStore.js4
-rw-r--r--src/stores/ServicesStore.js9
2 files changed, 9 insertions, 4 deletions
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index d2842083c..b7130904b 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -7,6 +7,7 @@ import delayApp from '../features/delayApp';
7import spellchecker from '../features/spellchecker'; 7import spellchecker from '../features/spellchecker';
8import serviceProxy from '../features/serviceProxy'; 8import serviceProxy from '../features/serviceProxy';
9import basicAuth from '../features/basicAuth'; 9import basicAuth from '../features/basicAuth';
10import workspaces from '../features/workspaces';
10import shareFranz from '../features/shareFranz'; 11import shareFranz from '../features/shareFranz';
11 12
12import { DEFAULT_FEATURES_CONFIG } from '../config'; 13import { DEFAULT_FEATURES_CONFIG } from '../config';
@@ -38,7 +39,7 @@ export default class FeaturesStore extends Store {
38 39
39 @computed get features() { 40 @computed get features() {
40 if (this.stores.user.isLoggedIn) { 41 if (this.stores.user.isLoggedIn) {
41 return this.featuresRequest.execute().result || DEFAULT_FEATURES_CONFIG; 42 return Object.assign({}, DEFAULT_FEATURES_CONFIG, this.featuresRequest.execute().result);
42 } 43 }
43 44
44 return DEFAULT_FEATURES_CONFIG; 45 return DEFAULT_FEATURES_CONFIG;
@@ -57,6 +58,7 @@ export default class FeaturesStore extends Store {
57 spellchecker(this.stores, this.actions); 58 spellchecker(this.stores, this.actions);
58 serviceProxy(this.stores, this.actions); 59 serviceProxy(this.stores, this.actions);
59 basicAuth(this.stores, this.actions); 60 basicAuth(this.stores, this.actions);
61 workspaces(this.stores, this.actions);
60 shareFranz(this.stores, this.actions); 62 shareFranz(this.stores, this.actions);
61 } 63 }
62} 64}
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 69e616f0c..cc8eed65b 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -12,6 +12,7 @@ import Request from './lib/Request';
12import CachedRequest from './lib/CachedRequest'; 12import CachedRequest from './lib/CachedRequest';
13import { matchRoute } from '../helpers/routing-helpers'; 13import { matchRoute } from '../helpers/routing-helpers';
14import { gaEvent } from '../lib/analytics'; 14import { gaEvent } from '../lib/analytics';
15import { filterServicesByActiveWorkspace, getActiveWorkspaceServices } from '../features/workspaces';
15 16
16const debug = require('debug')('Franz:ServiceStore'); 17const debug = require('debug')('Franz:ServiceStore');
17 18
@@ -99,7 +100,6 @@ export default class ServicesStore extends Store {
99 return observable(services.slice().slice().sort((a, b) => a.order - b.order)); 100 return observable(services.slice().slice().sort((a, b) => a.order - b.order));
100 } 101 }
101 } 102 }
102
103 return []; 103 return [];
104 } 104 }
105 105
@@ -108,13 +108,16 @@ export default class ServicesStore extends Store {
108 } 108 }
109 109
110 @computed get allDisplayed() { 110 @computed get allDisplayed() {
111 return this.stores.settings.all.app.showDisabledServices ? this.all : this.enabled; 111 const services = this.stores.settings.all.app.showDisabledServices ? this.all : this.enabled;
112 return filterServicesByActiveWorkspace(services);
112 } 113 }
113 114
114 // This is just used to avoid unnecessary rerendering of resource-heavy webviews 115 // This is just used to avoid unnecessary rerendering of resource-heavy webviews
115 @computed get allDisplayedUnordered() { 116 @computed get allDisplayedUnordered() {
117 const { showDisabledServices } = this.stores.settings.all.app;
116 const services = this.allServicesRequest.execute().result || []; 118 const services = this.allServicesRequest.execute().result || [];
117 return this.stores.settings.all.app.showDisabledServices ? services : services.filter(service => service.isEnabled); 119 const filteredServices = showDisabledServices ? services : services.filter(service => service.isEnabled);
120 return getActiveWorkspaceServices(filteredServices);
118 } 121 }
119 122
120 @computed get filtered() { 123 @computed get filtered() {