diff options
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r-- | src/stores/ServicesStore.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 076ecc204..6120ae023 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -34,6 +34,11 @@ export default class ServicesStore extends Store { | |||
34 | 34 | ||
35 | @observable filterNeedle = null; | 35 | @observable filterNeedle = null; |
36 | 36 | ||
37 | // Array of service IDs that have recently been used | ||
38 | // [0] => Most recent, [n] => Least recent | ||
39 | // No service ID should be in the list multiple times, not all service IDs have to be in the list | ||
40 | @observable lastUsedServices = []; | ||
41 | |||
37 | constructor(...args) { | 42 | constructor(...args) { |
38 | super(...args); | 43 | super(...args); |
39 | 44 | ||
@@ -325,6 +330,10 @@ export default class ServicesStore extends Store { | |||
325 | }); | 330 | }); |
326 | service.isActive = true; | 331 | service.isActive = true; |
327 | 332 | ||
333 | // Update list of last used services | ||
334 | this.lastUsedServices = this.lastUsedServices.filter(id => id !== serviceId); | ||
335 | this.lastUsedServices.unshift(serviceId); | ||
336 | |||
328 | this._focusActiveService(); | 337 | this._focusActiveService(); |
329 | } | 338 | } |
330 | 339 | ||