Merged PR 17: Implement rigid body Fix multiple bugs
Implement rigid body Fix saveload bug: having null elements Fix events being duplicated and not being removed
This commit is contained in:
parent
d2e1d9f0a4
commit
616fe3e9ac
22 changed files with 804 additions and 95 deletions
|
@ -23,6 +23,7 @@ export const App: React.FunctionComponent<IAppProps> = (props) => {
|
|||
const [editorState, setEditorState] = useState<IEditorState>({
|
||||
configuration: DEFAULT_CONFIG,
|
||||
history: [{
|
||||
LastAction: '',
|
||||
MainContainer: defaultMainContainer,
|
||||
SelectedContainer: defaultMainContainer,
|
||||
SelectedContainerId: defaultMainContainer.properties.id,
|
||||
|
@ -40,14 +41,16 @@ export const App: React.FunctionComponent<IAppProps> = (props) => {
|
|||
return;
|
||||
}
|
||||
|
||||
fetch(state)
|
||||
.then(
|
||||
async(response) => await response.json(),
|
||||
(error) => { throw new Error(error); }
|
||||
)
|
||||
.then((data: IEditorState) => {
|
||||
LoadState(data, setEditorState, setLoaded);
|
||||
}, (error) => { throw new Error(error); });
|
||||
if (!isLoaded) {
|
||||
fetch(state)
|
||||
.then(
|
||||
async(response) => await response.json(),
|
||||
(error) => { throw new Error(error); }
|
||||
)
|
||||
.then((data: IEditorState) => {
|
||||
LoadState(data, setEditorState, setLoaded);
|
||||
}, (error) => { throw new Error(error); });
|
||||
}
|
||||
});
|
||||
|
||||
if (isLoaded) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue