diff --git a/src/frontend/app/actions/actions.service.ts b/src/frontend/app/actions/actions.service.ts index e5b623b1bf29c1609ae88ed097700390fc4bf352..b5383b3dc6baa25f27e2fd706fcf8be6705fa5af 100644 --- a/src/frontend/app/actions/actions.service.ts +++ b/src/frontend/app/actions/actions.service.ts @@ -304,15 +304,18 @@ export class ActionsService { tap((result: any) => { this.endAction(result); let firstGroup: number = 0; + let redirectAfterClose = ''; this.headerService.user.groups.filter((group: any) => group.can_index === true).forEach((group: any) => { if (firstGroup == 0) { firstGroup = group.id; } if (group.id == this.currentGroupId) { - this.router.navigate(['/indexing/' + this.currentGroupId]); + redirectAfterClose = '/indexing/' + this.currentGroupId; } }); - if (firstGroup == 0) { + if (redirectAfterClose != '') { + this.router.navigate([redirectAfterClose]); + } else if (firstGroup == 0) { this.router.navigate(['/home']); } else { this.router.navigate(['/indexing/' + firstGroup]); diff --git a/src/frontend/app/notes/note-editor.component.ts b/src/frontend/app/notes/note-editor.component.ts index 532ea4dd4941ceddc8202ea1ba1d8470ababf873..a36d5781854dd4f496c910ce16f2d33ffc247135 100644 --- a/src/frontend/app/notes/note-editor.component.ts +++ b/src/frontend/app/notes/note-editor.component.ts @@ -134,7 +134,7 @@ export class NoteEditorComponent implements OnInit { getTemplatesNote() { if (this.templatesNote.length == 0) { let params = {}; - if (this.resIds.length == 1) { + if (!this.functions.empty(this.resIds) && this.resIds.length == 1) { params['resId'] = this.resIds[0]; } this.http.get("../../rest/notesTemplates", { params: params }) @@ -149,7 +149,7 @@ export class NoteEditorComponent implements OnInit { return new Promise((resolve, reject) => { if (this.entities.length == 0) { let params = {}; - if (this.resIds.length == 1) { + if (!this.functions.empty(this.resIds) && this.resIds.length == 1) { params['resId'] = this.resIds[0]; } this.http.get("../../rest/entities").pipe(