From 87ebed623f5ffdc3cfd7f707268b508c8ed6bb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Tue, 7 Mar 2023 12:06:20 +0100 Subject: [PATCH] Don't provide props via navigating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- src/components/TaskBody.vue | 22 +++++++++------------- src/views/AppSidebar.vue | 2 +- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/components/TaskBody.vue b/src/components/TaskBody.vue index 6aadc9962..49b58d6d3 100644 --- a/src/components/TaskBody.vue +++ b/src/components/TaskBody.vue @@ -533,41 +533,37 @@ export default { * Navigates to a different route, but checks if navigation is desired * * @param {object} $event the event that triggered navigation - * @param {string} active the tab active in the AppSidebar */ - navigate($event, active) { + async navigate($event) { if (!$event.target.closest('.no-nav') && (this.$route.params.taskId !== this.task.uri || this.$route.params.collectionParam !== this.collectionParam)) { if (!this.task.loadedCompleted) { this.getTasksFromCalendar({ calendar: this.task.calendar, completed: true, related: this.task.uid }) } if (this.$route.params.calendarId) { - this.$router.push({ + await this.$router.push({ name: 'calendarsTask', params: { calendarId: this.$route.params.calendarId, taskId: this.task.uri, - active, }, }) } else if (this.collectionId) { if (this.collectionParam) { - this.$router.push({ + await this.$router.push({ name: 'collectionsParamTask', params: { collectionId: this.collectionId, collectionParam: this.collectionParam, taskId: this.task.uri, - active, }, }) } else { - this.$router.push({ + await this.$router.push({ name: 'collectionsTask', params: { collectionId: this.collectionId, taskId: this.task.uri, - active, }, }) } @@ -575,11 +571,11 @@ export default { } }, - openAppSidebarTab($event, tab, edit = false) { - // Open the AppSidebar - this.navigate($event, tab) - // In case it is already open, we also have to emit an event to show the tab - emit('tasks:open-appsidebar-tab', { tab }) + async openAppSidebarTab($event, tab, edit = false) { + // Open the AppSidebar and wait for it to be mounted + await this.navigate($event) + // Emit event to show the tab + emit('tasks:open-appsidebar-tab', tab) if (edit) { emit('tasks:edit-appsidebar-notes', $event) } diff --git a/src/views/AppSidebar.vue b/src/views/AppSidebar.vue index 20e941e88..ab7d50c57 100644 --- a/src/views/AppSidebar.vue +++ b/src/views/AppSidebar.vue @@ -788,7 +788,7 @@ export default { } }, - openAppSidebarTab({ tab }) { + openAppSidebarTab(tab) { this.activeTab = tab },