From 9f3a538492b91c2879971d77c2b40aa3c082a40b Mon Sep 17 00:00:00 2001 From: srgooglo Date: Wed, 1 Jun 2022 20:18:55 +0200 Subject: [PATCH] Render layout even when has renderlock --- packages/app/src/layout/index.jsx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/app/src/layout/index.jsx b/packages/app/src/layout/index.jsx index 9a78462c..c92a1a1b 100644 --- a/packages/app/src/layout/index.jsx +++ b/packages/app/src/layout/index.jsx @@ -95,6 +95,10 @@ export default class Layout extends React.Component { this.setLayout("default") } }) + + window.app.setLocation = (location) => { + return window.history.pushState(null, null, location) + } } onTransitionStart = () => { @@ -114,13 +118,7 @@ export default class Layout extends React.Component { } render() { - if (this.state.renderLock) { - if (this.props.staticRenders?.Initialization) { - return React.createElement(this.props.staticRenders.Initialization) - } - - return null - } + const InitializationComponent = this.props.staticRenders?.Initialization ? React.createElement(this.props.staticRenders.Initialization) : null if (this.state.renderError) { if (this.props.staticRenders?.RenderError) { @@ -133,7 +131,7 @@ export default class Layout extends React.Component { const layoutComponentProps = { ...this.props.bindProps, ...this.state, - children: this.props.children, + children: this.state.RenderChildren, layoutPageModesClassnames: [{ ["noMargin"]: this.state.compactMode, }], @@ -141,10 +139,10 @@ export default class Layout extends React.Component { onTransitionFinish: this.onTransitionFinish, } - if (LayoutRenders[this.state.layoutType]) { - return LayoutRenders[this.state.layoutType](layoutComponentProps) - } + const Layout = LayoutRenders[this.state.layoutType] - return LayoutRenders.default(layoutComponentProps) + return + {this.state.renderLock ? InitializationComponent : this.props.children} + } } \ No newline at end of file