aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Adrian Klaeger <adrian.klaeger@gmail.com>2021-11-14 04:01:37 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-14 08:31:37 +0530
commit8e076d4763831059573abc6fa98bd67fe3b3f3dc (patch)
treefd4cf6a269c801b009526dc61d7d9339116ddffc /src
parentdocs: add klaegera as a contributor for code, bug (#2225) (diff)
downloadferdium-app-8e076d4763831059573abc6fa98bd67fe3b3f3dc.tar.gz
ferdium-app-8e076d4763831059573abc6fa98bd67fe3b3f3dc.tar.zst
ferdium-app-8e076d4763831059573abc6fa98bd67fe3b3f3dc.zip
Fix service activation and hibernation timeout (#2224)
Fixes issue #2051
Diffstat (limited to 'src')
-rw-r--r--src/stores/ServicesStore.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index a34390d88..16deb91c5 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -587,7 +587,10 @@ export default class ServicesStore extends Store {
587 const service = this.one(serviceId); 587 const service = this.one(serviceId);
588 588
589 for (const s of this.all) { 589 for (const s of this.all) {
590 s.isActive = false; 590 if (s.isActive) {
591 s.lastUsed = Date.now();
592 s.isActive = false;
593 }
591 } 594 }
592 service.isActive = true; 595 service.isActive = true;
593 this._awake({ serviceId: service.id }); 596 this._awake({ serviceId: service.id });
@@ -624,12 +627,7 @@ export default class ServicesStore extends Store {
624 this.allDisplayed.length, 627 this.allDisplayed.length,
625 ); 628 );
626 629
627 for (const s of this.all) { 630 this._setActive({ serviceId: this.allDisplayed[nextIndex].id });
628 s.isActive = false;
629 }
630 this.allDisplayed[nextIndex].isActive = true;
631
632 this._focusActiveService();
633 } 631 }
634 632
635 @action _setActivePrev() { 633 @action _setActivePrev() {
@@ -639,12 +637,7 @@ export default class ServicesStore extends Store {
639 this.allDisplayed.length, 637 this.allDisplayed.length,
640 ); 638 );
641 639
642 for (const s of this.all) { 640 this._setActive({ serviceId: this.allDisplayed[prevIndex].id });
643 s.isActive = false;
644 }
645 this.allDisplayed[prevIndex].isActive = true;
646
647 this._focusActiveService();
648 } 641 }
649 642
650 @action _setUnreadMessageCount({ serviceId, count }) { 643 @action _setUnreadMessageCount({ serviceId, count }) {