From e9154924f81c76afda46a9640ae3a3d51fcebf4a Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 13 Apr 2021 19:21:40 +0200 Subject: [PATCH] Fixed missing history, due to visibility --- src/components/juggl/JugglTagField.vue | 1 - src/services/juggl.service.js | 3 +++ src/store/modules/juggl.js | 8 ++++++-- src/views/History.vue | 2 +- src/views/Home.vue | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/juggl/JugglTagField.vue b/src/components/juggl/JugglTagField.vue index 02b0fb3..2bd757e 100644 --- a/src/components/juggl/JugglTagField.vue +++ b/src/components/juggl/JugglTagField.vue @@ -110,7 +110,6 @@ export default { } }, addedTags: function() { - Object.values(this.record.tags).forEach(t => console.log(t.visible)); return Object.values(this.record.tags).filter( t => !this.onlyVisible || t.visible ); diff --git a/src/services/juggl.service.js b/src/services/juggl.service.js index 30d97d0..b505c3a 100644 --- a/src/services/juggl.service.js +++ b/src/services/juggl.service.js @@ -98,6 +98,9 @@ export const jugglService = { if (options.finished !== undefined) { payload.finished = options.finished; } + if (options.visible !== undefined) { + payload.visible = options.visible; + } return apiService.post("/getRecords.php", payload).then(r => { return { diff --git a/src/store/modules/juggl.js b/src/store/modules/juggl.js index 36a1f02..278b111 100644 --- a/src/store/modules/juggl.js +++ b/src/store/modules/juggl.js @@ -200,12 +200,16 @@ export const juggl = { return true; }); }, - loadRecords({ commit, state, getters }, { limit, finished }) { + loadRecords({ commit, state, getters }, { limit, finished, visible }) { if (limit !== undefined) { commit("setRecordsLimit", limit); } - var payload = { limit: state.recordsLimit, finished: finished }; + var payload = { + limit: state.recordsLimit, + finished: finished, + visible: visible + }; return jugglService.getRecords(payload).then(r => { var allRecords = Object.values(r.data.records); diff --git a/src/views/History.vue b/src/views/History.vue index 996afec..e8ed581 100644 --- a/src/views/History.vue +++ b/src/views/History.vue @@ -60,7 +60,7 @@ export default { store.dispatch("loadTags"); store.dispatch("loadProjects"); store - .dispatch("loadRecords", { limit: 0, finished: true }) + .dispatch("loadRecords", { limit: 0, finished: true, visible: true }) .then(() => { this.working = false; }) diff --git a/src/views/Home.vue b/src/views/Home.vue index a733432..9f8c397 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -57,7 +57,7 @@ export default { store.dispatch("loadProjects"); store.dispatch("loadTags"); store.dispatch("loadRunningRecords"); - store.dispatch("loadRecords", { limit: 10, finished: true }); + store.dispatch("loadRecords", { limit: 10, finished: true, visible: true }); } };