diff --git a/ayanova/src/views/home-schedule.vue b/ayanova/src/views/home-schedule.vue index 22804117..7db4040d 100644 --- a/ayanova/src/views/home-schedule.vue +++ b/ayanova/src/views/home-schedule.vue @@ -478,10 +478,15 @@ export default { hour12: window.$gz.locale.getHour12(), formUserOptions: {}, tempFirstTime: null, - lastMouseDownMS: null + lastMouseDownMS: null, + lastStart: null, + lastEnd: null }; }, methods: { + async refresh() { + await this.fetchEvents({ start: null, end: null }); + }, openObject: function(type, id) { window.$gz.eventBus.$emit("openobject", { type: type, @@ -817,6 +822,13 @@ export default { } }, async fetchEvents({ start, end }) { + if (start) { + this.lastStart = start; + this.lastEnd = end; + } else { + start = this.lastStart; + end = this.lastEnd; + } try { window.$gz.form.deleteAllErrorBoxErrors(this); const res = await window.$gz.api.post("schedule/personal", { @@ -877,11 +889,7 @@ export default { async saveUserOptions() { this.settingsDialog = false; await saveFormUserOptions(this); - //doesn't seem to be any reliable way to trigger refresh on the calendar itself - //and trying to load the events manually is not working out as the calendar reports a different - //start and end than it provides for the change event - //this is brutal but works - window.location.reload(); + await this.refresh(); } //eom }, diff --git a/ayanova/src/views/svc-schedule.vue b/ayanova/src/views/svc-schedule.vue index baade3bc..3da5dee3 100644 --- a/ayanova/src/views/svc-schedule.vue +++ b/ayanova/src/views/svc-schedule.vue @@ -411,11 +411,7 @@ export default { }, methods: { async refresh() { - console.log("REFRESH"); await this.fetchEvents({ start: null, end: null }); - //this.focus = null; //""; - // this.categories.splice(0); - // this.$refs.calendar.checkChange(); }, openObject: function(type, id) { window.$gz.eventBus.$emit("openobject", { @@ -772,20 +768,13 @@ export default { } }, async fetchEvents({ start, end }) { - console.log("fetchEvents ", { start: start, end: end }); if (start) { - console.log("Saving last dates"); this.lastStart = start; this.lastEnd = end; } else { - console.log("rehydrating from last dates"); start = this.lastStart; end = this.lastEnd; } - /* - - { items = r, users = Users } - */ try { window.$gz.form.deleteAllErrorBoxErrors(this); const res = await window.$gz.api.post("schedule/svc", { @@ -850,11 +839,7 @@ export default { async saveUserOptions() { this.settingsDialog = false; await saveFormUserOptions(this); - //doesn't seem to be any reliable way to trigger refresh on the calendar itself - //and trying to load the events manually is not working out as the calendar reports a different - //start and end than it provides for the change event - //this is brutal but works - window.location.reload(); + await this.refresh(); } //eom },