diff options
author | 2018-03-14 20:37:31 +0100 | |
---|---|---|
committer | 2018-03-14 20:37:31 +0100 | |
commit | 82e832c09b2e013d3643e02a8a366cd4f3900b63 (patch) | |
tree | bc2c20dc7f435497edbc417fc51c0fb845c1c167 | |
parent | feat(Mac): Add dock bounce when new update is available (diff) | |
download | ferdium-app-82e832c09b2e013d3643e02a8a366cd4f3900b63.tar.gz ferdium-app-82e832c09b2e013d3643e02a8a366cd4f3900b63.tar.zst ferdium-app-82e832c09b2e013d3643e02a8a366cd4f3900b63.zip |
feat(Services): Improve performance when reordering services
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 2 | ||||
-rw-r--r-- | src/stores/ServicesStore.js | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index e4a9d60c3..075bd5e34 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -94,7 +94,7 @@ export default class AppLayoutContainer extends Component { | |||
94 | 94 | ||
95 | const servicesContainer = ( | 95 | const servicesContainer = ( |
96 | <Services | 96 | <Services |
97 | services={services.allDisplayed} | 97 | services={services.allDisplayedUnordered} |
98 | handleIPCMessage={handleIPCMessage} | 98 | handleIPCMessage={handleIPCMessage} |
99 | setWebviewReference={setWebviewReference} | 99 | setWebviewReference={setWebviewReference} |
100 | openWindow={openWindow} | 100 | openWindow={openWindow} |
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index c38d0d9ee..c2dbff55d 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -87,6 +87,12 @@ export default class ServicesStore extends Store { | |||
87 | return this.stores.settings.all.showDisabledServices ? this.all : this.enabled; | 87 | return this.stores.settings.all.showDisabledServices ? this.all : this.enabled; |
88 | } | 88 | } |
89 | 89 | ||
90 | // This is just used to avoid unnecessary rerendering of resource-heavy webviews | ||
91 | @computed get allDisplayedUnordered() { | ||
92 | const services = this.allServicesRequest.execute().result || []; | ||
93 | return this.stores.settings.all.showDisabledServices ? services : services.filter(service => service.isEnabled); | ||
94 | } | ||
95 | |||
90 | @computed get filtered() { | 96 | @computed get filtered() { |
91 | return this.all.filter(service => service.name.toLowerCase().includes(this.filterNeedle.toLowerCase())); | 97 | return this.all.filter(service => service.name.toLowerCase().includes(this.filterNeedle.toLowerCase())); |
92 | } | 98 | } |