aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/ServicesStore.js
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-11-18 17:37:45 +0100
committerLibravatar GitHub <noreply@github.com>2021-11-18 22:07:45 +0530
commitb37a6b07b39c8c7827052dc6fb97f490f1e0f514 (patch)
tree0276e7c51f5ebfa14c566def7aac39f014c2291d /src/stores/ServicesStore.js
parentUpdate github issues template [skip ci] (diff)
downloadferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.tar.gz
ferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.tar.zst
ferdium-app-b37a6b07b39c8c7827052dc6fb97f490f1e0f514.zip
chore: convert various files to TS (#2246)
* convert various files to TS * removed outdated docs/example-feature folder * turn off unicorn/no-empty-file * update eslint config
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r--src/stores/ServicesStore.js56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js
index 16deb91c5..3d418c4c5 100644
--- a/src/stores/ServicesStore.js
+++ b/src/stores/ServicesStore.js
@@ -655,20 +655,20 @@ export default class ServicesStore extends Store {
655 655
656 @action _setWebviewReference({ serviceId, webview }) { 656 @action _setWebviewReference({ serviceId, webview }) {
657 const service = this.one(serviceId); 657 const service = this.one(serviceId);
658 658 if (service) {
659 service.webview = webview; 659 service.webview = webview;
660 660
661 if (!service.isAttached) { 661 if (!service.isAttached) {
662 debug('Webview is not attached, initializing'); 662 debug('Webview is not attached, initializing');
663 service.initializeWebViewEvents({ 663 service.initializeWebViewEvents({
664 handleIPCMessage: this.actions.service.handleIPCMessage, 664 handleIPCMessage: this.actions.service.handleIPCMessage,
665 openWindow: this.actions.service.openWindow, 665 openWindow: this.actions.service.openWindow,
666 stores: this.stores, 666 stores: this.stores,
667 }); 667 });
668 service.initializeWebViewListener(); 668 service.initializeWebViewListener();
669 }
670 service.isAttached = true;
669 } 671 }
670
671 service.isAttached = true;
672 } 672 }
673 673
674 @action _detachService({ service }) { 674 @action _detachService({ service }) {
@@ -690,20 +690,22 @@ export default class ServicesStore extends Store {
690 // TODO: add checks to not focus service when router path is /settings or /auth 690 // TODO: add checks to not focus service when router path is /settings or /auth
691 const service = this.active; 691 const service = this.active;
692 if (service) { 692 if (service) {
693 document.title = `Ferdi - ${service.name} ${ 693 if (service._webview) {
694 service.dialogTitle ? ` - ${service.dialogTitle}` : '' 694 document.title = `Ferdi - ${service.name} ${
695 } ${service._webview ? `- ${service._webview.getTitle()}` : ''}`; 695 service.dialogTitle ? ` - ${service.dialogTitle}` : ''
696 this._focusService({ serviceId: service.id }); 696 } ${service._webview ? `- ${service._webview.getTitle()}` : ''}`;
697 if (this.stores.settings.app.splitMode && !focusEvent) { 697 this._focusService({ serviceId: service.id });
698 setTimeout(() => { 698 if (this.stores.settings.app.splitMode && !focusEvent) {
699 document 699 setTimeout(() => {
700 .querySelector('.services__webview-wrapper.is-active') 700 document
701 .scrollIntoView({ 701 .querySelector('.services__webview-wrapper.is-active')
702 behavior: 'smooth', 702 .scrollIntoView({
703 block: 'end', 703 behavior: 'smooth',
704 inline: 'nearest', 704 block: 'end',
705 }); 705 inline: 'nearest',
706 }, 10); 706 });
707 }, 10);
708 }
707 } 709 }
708 } else { 710 } else {
709 debug('No service is active'); 711 debug('No service is active');