diff --git a/frontend/src/Components/ArtPage.tsx b/frontend/src/Components/ArtPage.tsx index 464e4cdabc31b65e2a7b7d5a9d5fe5538cd6d342..2b1831e7902fcd026f80ef317412c66795e0b15e 100644 --- a/frontend/src/Components/ArtPage.tsx +++ b/frontend/src/Components/ArtPage.tsx @@ -35,8 +35,9 @@ class ArtPage extends React.Component<props, state> { const pageId = this.props.pageId.toString(); const choices = sessionStorage.getItem(pageId); // Previously stored options. Saved as string if (choices != null) { // We have stored something previously - const choicesObject = JSON.parse(choices); // Convert string to object - sessionStorage.setItem(pageId, {...choicesObject, [label]: choice}); // Update choices + const choicesObject: object = JSON.parse(choices); // Convert string to object + let choicesObjectStringified : string = JSON.stringify({...choicesObject, [label]: choice}); + sessionStorage.setItem(pageId, choicesObjectStringified); // Update choices } else sessionStorage.setItem(pageId, JSON.stringify({...this.state.options, [label]: choice})); };