fix setting load

This commit is contained in:
undefined committed 2020-07-16 16:52:51 +08:00
1 parent 2d5eef8d08
commit 0f23611853
4 files changed
+15 -4

No files matched your search

@@ -16,7 +16,6 @@ export default function reducer(state = {
return {
...state,
output: (rdoc.stdout || '') + (rdoc.stderr || ''),
rid: null,
};
}
}
+11 -1
View File
@@ -15,9 +15,19 @@ export default function reducer(state = {
}
case 'SCRATCHPAD_RECORDS_PUSH': {
const { rdoc } = action.payload;
const rows = [...state.rows];
if (!rows.includes(rdoc._id)) {
return {
...state,
rows: [rdoc._id, ...state.rows],
items: {
...state.items,
[rdoc._id]: rdoc,
},
};
}
return {
...state,
rows: [rdoc._id, ...state.rows],
items: {
...state.items,
[rdoc._id]: rdoc,