Web: Doceditor: fixed name of global state
This commit is contained in:
parent
a0317e1ba5
commit
f4f8cc42f5
@ -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();
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user