Skip to content

Commit 197901a

Browse files
committed
swapped hash with actual item and props
1 parent 62ec2ac commit 197901a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

dash/dash-renderer/src/reducers/reducer.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ export const apiRequests = [
3030
function adjustHashes(state, action) {
3131
const actionPath = action.payload.itempath;
3232
const strPath = stringifyPath(actionPath);
33-
const prev = pathOr('0', [strPath], state);
33+
const prev = pathOr(0, [strPath, 0], state);
3434
state = assoc(
3535
strPath,
36-
`${parseInt(prev.split(' -')[0]) + 1} - ${JSON.stringify(
37-
action.payload.props
38-
)}`,
36+
[prev + 1, action.payload.props],
3937
state
4038
);
4139
return state;

dash/dash-renderer/src/wrapper/selectors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export const selectDashProps =
1616
let h = 0;
1717
let changedProps: object = {};
1818
if (hash) {
19-
h = parseInt(hash.split(' -')[0]);
20-
changedProps = JSON.parse(hash.split('- ')[1]);
19+
h = hash[0];
20+
changedProps = hash[1];
2121
}
2222
return [c, c?.props, h, changedProps];
2323
};

0 commit comments

Comments
 (0)