diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-10-04 18:55:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-04 18:55:51 +0200 |
commit | b521a232ac7c79527d0f3c9baa46695fa5d5e62d (patch) | |
tree | 4a8af14730b665e4e1a662239a4cd3ead3bb3da9 | |
parent | Merge branch 'i18n' into release/5.4.0 (diff) | |
parent | Remove console.log (diff) | |
download | ferdium-app-b521a232ac7c79527d0f3c9baa46695fa5d5e62d.tar.gz ferdium-app-b521a232ac7c79527d0f3c9baa46695fa5d5e62d.tar.zst ferdium-app-b521a232ac7c79527d0f3c9baa46695fa5d5e62d.zip |
fix(Workspaces): Only initialize active Workspace services when app is starting
Fix/only load workspace related services
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 4 | ||||
-rw-r--r-- | src/features/workspaces/store.js | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index b3198d36a..4bab4a964 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -37,7 +37,9 @@ class ServiceWebview extends Component { | |||
37 | <ElectronWebView | 37 | <ElectronWebView |
38 | ref={(webview) => { | 38 | ref={(webview) => { |
39 | this.webview = webview; | 39 | this.webview = webview; |
40 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | 40 | if (webview && webview.view) { |
41 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | ||
42 | } | ||
41 | }} | 43 | }} |
42 | autosize | 44 | autosize |
43 | src={service.url} | 45 | src={service.url} |
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 7f41cfc88..f08323e6c 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js | |||
@@ -141,8 +141,16 @@ export default class WorkspacesStore extends FeatureStore { | |||
141 | 141 | ||
142 | filterServicesByActiveWorkspace = (services) => { | 142 | filterServicesByActiveWorkspace = (services) => { |
143 | const { activeWorkspace, isFeatureActive } = this; | 143 | const { activeWorkspace, isFeatureActive } = this; |
144 | if (isFeatureActive && activeWorkspace) { | 144 | if (isFeatureActive) { |
145 | return this.getWorkspaceServices(activeWorkspace); | 145 | if (activeWorkspace) { |
146 | return this.getWorkspaceServices(activeWorkspace); | ||
147 | } | ||
148 | // There is no active workspace yet but we might be still loading them | ||
149 | if (!getUserWorkspacesRequest.wasExecuted || getUserWorkspacesRequest.isExecutingFirstTime) { | ||
150 | // If so, do not show any services to avoid loading all of them unfiltered | ||
151 | // and then having the filter flashing in (which is ugly and slow). | ||
152 | return []; | ||
153 | } | ||
146 | } | 154 | } |
147 | return services; | 155 | return services; |
148 | }; | 156 | }; |