Revert "Fix applicationStateModel serialization"

This reverts commit aa15425dbc.
This commit is contained in:
Eric NGUYEN 2022-10-12 16:17:43 +02:00
parent 23bfaaea4e
commit ea2a2ab64c
5 changed files with 138 additions and 17 deletions

View file

@ -9,7 +9,7 @@ onmessage = async(e) => {
const request = {
ApplicationState: state
};
const dataParsed = JSON.stringify(request, GetCircularReplacer());
const dataParsed = JSON.stringify(request, GetCircularReplacerKeepDataStructure());
fetch(url, {
method: 'POST',
headers: new Headers({
@ -26,25 +26,13 @@ onmessage = async(e) => {
});
};
function GetCircularReplacer()
function GetCircularReplacerKeepDataStructure()
{
return (key, value) => {
if (key === 'parent') {
return;
}
if (key === 'containers') {
return Array.from(value.entries());
}
if (key === 'symbols') {
return Array.from(value.entries());
}
if (key === 'linkedContainers') {
return Array.from(value);
}
return value;
};
}