Skip to content

Commit

Permalink
Merge 609b4a2 into 221f275
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofengxi authored Aug 6, 2020
2 parents 221f275 + 609b4a2 commit 4e18619
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/panel/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ export function Layout(): React.ReactElement {
((data = event.data.payload), data?.type === "re-evaluation")
) {
const value = hydrate(data.payload, data.repo);
const { id, ...changeData } = value;
const { id, raw, result } = value;
setEvaluations((prev) => {
const selected = prev.find((item) => item.id === id);
selected && Object.assign(selected.detail, changeData);
selected &&
Object.assign(selected.detail, {
raw,
result: result.data || result.error,
});

return [...prev];
});
Expand Down Expand Up @@ -84,10 +88,14 @@ export function Layout(): React.ReactElement {
((data = event.data.payload), data?.type === "re-transformation")
) {
const value = hydrate(data.payload, data.repo);
const { id, ...changeData } = value;
const { id, transform, result } = value;
setTransformations((prev) => {
const selected = prev.find((item) => item.id === id);
selected && Object.assign(selected.detail, changeData);
selected &&
Object.assign(selected.detail, {
transform,
result: result.data || result.error,
});
return [...prev];
});
}
Expand Down

0 comments on commit 4e18619

Please sign in to comment.