aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar kytwb <kytwb@pm.me>2021-12-21 04:34:57 +0100
committerLibravatar kytwb <kytwb@pm.me>2021-12-21 04:34:57 +0100
commit2e30d3ae95592c3440c4347821c4f9e68b3e40b4 (patch)
tree0efa7df63f517c009b13140ec4660739d2090213
parentUpdate submodules, browserslist data updates and linter fixes [skip ci] (diff)
downloadferdium-app-2e30d3ae95592c3440c4347821c4f9e68b3e40b4.tar.gz
ferdium-app-2e30d3ae95592c3440c4347821c4f9e68b3e40b4.tar.zst
ferdium-app-2e30d3ae95592c3440c4347821c4f9e68b3e40b4.zip
Reduce AppLayout flashing
-rw-r--r--src/containers/layout/AppLayoutContainer.js9
-rw-r--r--src/stores.types.ts2
-rw-r--r--src/stores/SettingsStore.js6
3 files changed, 8 insertions, 9 deletions
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js
index c70144c8e..4bcd17409 100644
--- a/src/containers/layout/AppLayoutContainer.js
+++ b/src/containers/layout/AppLayoutContainer.js
@@ -22,7 +22,6 @@ import AppLoader from '../../components/ui/AppLoader';
22import { workspaceActions } from '../../features/workspaces/actions'; 22import { workspaceActions } from '../../features/workspaces/actions';
23import WorkspaceDrawer from '../../features/workspaces/components/WorkspaceDrawer'; 23import WorkspaceDrawer from '../../features/workspaces/components/WorkspaceDrawer';
24import { workspaceStore } from '../../features/workspaces'; 24import { workspaceStore } from '../../features/workspaces';
25import WorkspacesStore from '../../features/workspaces/store';
26 25
27class AppLayoutContainer extends Component { 26class AppLayoutContainer extends Component {
28 static defaultProps = { 27 static defaultProps = {
@@ -39,7 +38,6 @@ class AppLayoutContainer extends Component {
39 globalError, 38 globalError,
40 requests, 39 requests,
41 user, 40 user,
42 workspaces,
43 router 41 router
44 } = this.props.stores; 42 } = this.props.stores;
45 43
@@ -85,10 +83,12 @@ class AppLayoutContainer extends Component {
85 services.allServicesRequest.isExecuting && 83 services.allServicesRequest.isExecuting &&
86 services.allServicesRequest.isExecutingFirstTime; 84 services.allServicesRequest.isExecutingFirstTime;
87 85
86 const isLoadingSettings = !settings.loaded;
87
88 if ( 88 if (
89 isLoadingSettings ||
89 isLoadingFeatures || 90 isLoadingFeatures ||
90 isLoadingServices || 91 isLoadingServices
91 workspaces.isLoadingWorkspaces
92 ) { 92 ) {
93 return ( 93 return (
94 <ThemeProvider theme={ui.theme}> 94 <ThemeProvider theme={ui.theme}>
@@ -191,7 +191,6 @@ AppLayoutContainer.propTypes = {
191 user: PropTypes.instanceOf(UserStore).isRequired, 191 user: PropTypes.instanceOf(UserStore).isRequired,
192 requests: PropTypes.instanceOf(RequestStore).isRequired, 192 requests: PropTypes.instanceOf(RequestStore).isRequired,
193 globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired, 193 globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired,
194 workspaces: PropTypes.instanceOf(WorkspacesStore).isRequired,
195 }).isRequired, 194 }).isRequired,
196 actions: PropTypes.shape({ 195 actions: PropTypes.shape({
197 service: PropTypes.instanceOf(ServicesStore).isRequired, 196 service: PropTypes.instanceOf(ServicesStore).isRequired,
diff --git a/src/stores.types.ts b/src/stores.types.ts
index 34922c199..92531eb4a 100644
--- a/src/stores.types.ts
+++ b/src/stores.types.ts
@@ -212,7 +212,7 @@ interface SettingsStore {
212 actions: Actions; 212 actions: Actions;
213 api: Api; 213 api: Api;
214 fileSystemSettingsTypes: any[]; 214 fileSystemSettingsTypes: any[];
215 startup: boolean; 215 loaded: boolean;
216 stores: Stores; 216 stores: Stores;
217 updateAppSettingsRequest: () => void; 217 updateAppSettingsRequest: () => void;
218 _fileSystemSettingsCache: () => void; 218 _fileSystemSettingsCache: () => void;
diff --git a/src/stores/SettingsStore.js b/src/stores/SettingsStore.js
index ac9356404..e638d84b8 100644
--- a/src/stores/SettingsStore.js
+++ b/src/stores/SettingsStore.js
@@ -19,7 +19,7 @@ export default class SettingsStore extends Store {
19 'updateAppSettings', 19 'updateAppSettings',
20 ); 20 );
21 21
22 startup = true; 22 loaded = false;
23 23
24 fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES; 24 fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES;
25 25
@@ -84,11 +84,10 @@ export default class SettingsStore extends Store {
84 ipcRenderer.on('appSettings', (event, resp) => { 84 ipcRenderer.on('appSettings', (event, resp) => {
85 // Lock on startup if enabled in settings 85 // Lock on startup if enabled in settings
86 if ( 86 if (
87 this.startup && 87 !this.loaded &&
88 resp.type === 'app' && 88 resp.type === 'app' &&
89 resp.data.lockingFeatureEnabled 89 resp.data.lockingFeatureEnabled
90 ) { 90 ) {
91 this.startup = false;
92 process.nextTick(() => { 91 process.nextTick(() => {
93 if (!this.all.app.locked) { 92 if (!this.all.app.locked) {
94 this.all.app.locked = true; 93 this.all.app.locked = true;
@@ -97,6 +96,7 @@ export default class SettingsStore extends Store {
97 } 96 }
98 debug('Get appSettings resolves', resp.type, resp.data); 97 debug('Get appSettings resolves', resp.type, resp.data);
99 Object.assign(this._fileSystemSettingsCache[resp.type], resp.data); 98 Object.assign(this._fileSystemSettingsCache[resp.type], resp.data);
99 this.loaded = true;
100 ipcRenderer.send('initialAppSettings', resp); 100 ipcRenderer.send('initialAppSettings', resp);
101 }); 101 });
102 102