Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions src/components/TaskBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -533,53 +533,49 @@ 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,
},
})
}
}
}
},

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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ export default {
}
},

openAppSidebarTab({ tab }) {
openAppSidebarTab(tab) {
this.activeTab = tab
},

Expand Down