aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/features')
-rw-r--r--src/features/quickSwitch/Component.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/features/quickSwitch/Component.js b/src/features/quickSwitch/Component.js
index 02a349dee..cc2775178 100644
--- a/src/features/quickSwitch/Component.js
+++ b/src/features/quickSwitch/Component.js
@@ -140,12 +140,17 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
140 services = this.props.stores.services.allDisplayed; 140 services = this.props.stores.services.allDisplayed;
141 services = services.filter(service => service.name.toLowerCase().search(this.state.search.toLowerCase()) !== -1); 141 services = services.filter(service => service.name.toLowerCase().search(this.state.search.toLowerCase()) !== -1);
142 } else { 142 } else {
143 // Add the currently active service first
144 const currentService = this.props.stores.services.active;
145 if (currentService) {
146 services.push(currentService);
147 }
148
143 // Add last used services to services array 149 // Add last used services to services array
144 for (const service of this.props.stores.services.lastUsedServices) { 150 for (const service of this.props.stores.services.lastUsedServices) {
145 if (this.props.stores.services.one(service)) { 151 const tempService = this.props.stores.services.one(service);
146 services.push( 152 if (tempService && !services.includes(tempService)) {
147 this.props.stores.services.one(service), 153 services.push(tempService);
148 );
149 } 154 }
150 } 155 }
151 156
@@ -167,6 +172,7 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
167 172
168 // Reset and close modal 173 // Reset and close modal
169 this.setState({ 174 this.setState({
175 selected: 0,
170 search: '', 176 search: '',
171 }); 177 });
172 this.close(); 178 this.close();
@@ -192,7 +198,6 @@ export default @injectSheet(styles) @inject('stores', 'actions') @observer class
192 serviceElement.scrollIntoViewIfNeeded(false); 198 serviceElement.scrollIntoViewIfNeeded(false);
193 } 199 }
194 200
195
196 return { 201 return {
197 selected: newSelected, 202 selected: newSelected,
198 }; 203 };