Skip to content
Snippets Groups Projects
Unverified Commit 02774a2d authored by Dixon Fred's avatar Dixon Fred Committed by GitHub
Browse files

Merge pull request #5545 from antobinary/fix-versions

Support metadata with improper format
parents b6b93d89 ab54e568
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,15 @@ export function joinRouteHandler(nextState, replace, callback) {
const metakeys = metadata.length
? metadata.reduce((acc, meta) => {
const key = Object.keys(meta).shift();
/* this reducer tranform array of objects in a sigle object and
force the metadata a be boolean value */
return { ...acc, [key]: JSON.parse(meta[key]) };
/* this reducer transforms array of objects in a single object and
forces the metadata a be boolean value */
let value = meta[key];
try {
value = JSON.parse(meta[key]);
} catch (e) {
log('error', `Caught: ${e.message}`);
}
return { ...acc, [key]: value };
}) : {};
SessionStorage.setItem(METADATA_KEY, metakeys);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment