diff options
author | 2018-03-18 21:06:02 +0100 | |
---|---|---|
committer | 2018-03-18 21:06:02 +0100 | |
commit | a9efdf3e505fcbc94d9339f76700e7f56314fb0a (patch) | |
tree | 09e18159f33e363d28f59f93b428aadef2269f30 /src | |
parent | fix(Service Tabs): Remove "delete service" context menu when not in developme... (diff) | |
parent | feat(Services): Improve performance when reordering services (diff) | |
download | ferdium-app-a9efdf3e505fcbc94d9339f76700e7f56314fb0a.tar.gz ferdium-app-a9efdf3e505fcbc94d9339f76700e7f56314fb0a.tar.zst ferdium-app-a9efdf3e505fcbc94d9339f76700e7f56314fb0a.zip |
Merge pull request #798 from meetfranz/fix/order-performance
Improve order performance
Diffstat (limited to 'src')
-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 | } |