Permalink
Browse files

feat(Services): Improve performance when reordering services

  • Loading branch information...
adlk committed Mar 14, 2018
1 parent 47885bb commit 82e832c09b2e013d3643e02a8a366cd4f3900b63
Showing with 7 additions and 1 deletion.
  1. +1 −1 src/containers/layout/AppLayoutContainer.js
  2. +6 −0 src/stores/ServicesStore.js
@@ -94,7 +94,7 @@ export default class AppLayoutContainer extends Component {
const servicesContainer = (
<Services
services={services.allDisplayed}
services={services.allDisplayedUnordered}
handleIPCMessage={handleIPCMessage}
setWebviewReference={setWebviewReference}
openWindow={openWindow}
@@ -87,6 +87,12 @@ export default class ServicesStore extends Store {
return this.stores.settings.all.showDisabledServices ? this.all : this.enabled;
}
// This is just used to avoid unnecessary rerendering of resource-heavy webviews
@computed get allDisplayedUnordered() {
const services = this.allServicesRequest.execute().result || [];
return this.stores.settings.all.showDisabledServices ? services : services.filter(service => service.isEnabled);
}
@computed get filtered() {
return this.all.filter(service => service.name.toLowerCase().includes(this.filterNeedle.toLowerCase()));
}

0 comments on commit 82e832c

Please sign in to comment.