Fixed overwriting records bug
This commit is contained in:
parent
bc9e51d199
commit
64ba600a8f
1 changed files with 10 additions and 2 deletions
|
@ -112,7 +112,7 @@ export const juggl = {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadRecords({ commit, state }, { limit, finished }) {
|
loadRecords({ commit, state, getters }, { limit, finished }) {
|
||||||
if (limit !== undefined) {
|
if (limit !== undefined) {
|
||||||
commit("setRecordsLimit", limit);
|
commit("setRecordsLimit", limit);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,15 @@ export const juggl = {
|
||||||
var payload = { limit: state.recordsLimit, finished: finished };
|
var payload = { limit: state.recordsLimit, finished: finished };
|
||||||
|
|
||||||
return jugglService.getRecords(payload).then(r => {
|
return jugglService.getRecords(payload).then(r => {
|
||||||
commit("setRecords", r.data.records);
|
var allRecords = Object.values(r.data.records);
|
||||||
|
|
||||||
|
if (finished === true) {
|
||||||
|
allRecords = [...allRecords, ...getters.runningRecords];
|
||||||
|
} else if (finished === false) {
|
||||||
|
allRecords = [...allRecords, ...getters.finishedRecords];
|
||||||
|
}
|
||||||
|
|
||||||
|
commit("setRecords", allRecords);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadRunningRecords({ commit, getters }) {
|
loadRunningRecords({ commit, getters }) {
|
||||||
|
|
Loading…
Reference in a new issue