Web: Doceditor: fixed name of global state

This commit is contained in:
Artem Tarasov 2022-03-09 12:59:09 +03:00
parent a0317e1ba5
commit f4f8cc42f5
2 changed files with 7 additions and 7 deletions

View File

@ -3,14 +3,14 @@ import { hydrate } from "react-dom";
import { registerSW } from "@appserver/common/sw/helper";
import App from "../App.js";
const propsObj = window.__STATE__;
delete window.__STATE__;
const propsObj = window.__ASC_INITIAL_STATE__;
delete window.__ASC_INITIAL_STATE__;
const stateJS = document.getElementById("__STATE__");
//stateJS.parentNode.removeChild(stateJS);
const stateJS = document.getElementById("__ASC_INITIAL_STATE__");
stateJS.parentNode.removeChild(stateJS);
const { props } = propsObj;
console.log(props);
hydrate(<App {...props} />, document.getElementById("root"));
registerSW();

View File

@ -8,8 +8,8 @@ export default function template(
const { docApiUrl } = initialState.props;
const scripts = `
<script id="__STATE__">
window.__STATE__ = ${JSON.stringify(initialState)}
<script id="__ASC_INITIAL_STATE__">
window.__ASC_INITIAL_STATE__ = ${JSON.stringify(initialState)}
</script>
<script type='text/javascript' id='scripDocServiceAddress' src="${docApiUrl}" async></script>
${scriptTags}