From 3211a5af502b7e3741d3bf370311ba151ad8d403 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Thu, 1 Nov 2018 14:39:11 +0000 Subject: [PATCH] Tutor selection now persists between observation sessions. --- frontend/src/store.js | 7 ------- frontend/src/views/StartNew.vue | 14 ++++++++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/frontend/src/store.js b/frontend/src/store.js index 9211943..da600e2 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -26,13 +26,6 @@ export default new Vuex.Store({ }, setWhom(state, newWhom) { state.whom = newWhom; - }, - resetStore(state) { - state.site = null; - state.tutors = []; - state.description = null; - state.type = null; - state.whom = null; } }, actions: {} diff --git a/frontend/src/views/StartNew.vue b/frontend/src/views/StartNew.vue index cb5ced9..c857e9f 100644 --- a/frontend/src/views/StartNew.vue +++ b/frontend/src/views/StartNew.vue @@ -64,8 +64,7 @@

Select a site first.

- +
@@ -95,10 +94,12 @@ export default { loadingTutors: false, loaded: false, errorMessage: null, - errorStatus: null + errorStatus: null, + iTutors: [] }; }, mounted() { + this.iTutors = this.tutors; Vue.axios .get("/site") .then(response => { @@ -125,8 +126,13 @@ export default { site: function() { this.loadingTutors = true; this.tutorOptions = []; - this.tutors = []; this.getTutors(); + this.iTutors = this.iTutors.filter(x => this.tutorOptions.indexOf(x) !== -1) + }, + iTutors: function() { + if(this.tutors !== this.iTutors) { + this.setTutors(this.iTutors) + } } }, methods: {