fix(editor): switching to sidebar after creating a new event

Fix #5840

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
Richard Steinmetz 2024-03-20 17:06:44 +01:00
parent d28d1a5ccd
commit c3df245dcc
No known key found for this signature in database
GPG Key ID: 27137D9E7D273FB2
1 changed files with 8 additions and 1 deletions

View File

@ -384,12 +384,19 @@ export default {
this.$refs.popover.$children[0].$refs.popper.init()
},
/**
* Save changes and return to viewing mode or stay in editing mode if an error occurrs
* Save changes and leave when creating a new event or return to viewing mode when editing
* an existing event. Stay in editing mode if an error occurrs.
*
* @param {boolean} thisAndAllFuture Modify this and all future events
* @return {Promise<void>}
*/
async saveAndView(thisAndAllFuture) {
// Transitioning from new to edit routes is not implemented for now
if (this.isNew) {
await this.saveAndLeave(thisAndAllFuture)
return
}
this.isViewing = true
try {
await this.save(thisAndAllFuture)