Skip to content

Commit

Permalink
Fix issue #4217
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Oct 4, 2024
1 parent ec5eea7 commit fae3df9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/app/src/app-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {BehaviorSubject, Observable} from "rxjs";
providedIn: "root"
})
export class AppDataService {

private showLoadingPanelSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
showLoadingPanel$: Observable<boolean> = this.showLoadingPanelSubject.asObservable();

Expand All @@ -33,6 +32,7 @@ export class AppDataService {
receivers_by_id: any = {};
submissionStatuses: any[];
submission_statuses_by_id: any;
context_id = "";
contexts_by_id: any = {};
questionnaires_by_id: any = {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class SubmissionComponent implements OnInit {

ngOnInit(): void {
this.route.queryParamMap.subscribe(params => {
this.context_id = params.get('context') || "";
this.appDataService.context_id = params.get('context') || this.appDataService.context_id;
this.initializeSubmission();
});
}
Expand Down Expand Up @@ -116,8 +116,8 @@ export class SubmissionComponent implements OnInit {

this.selectable_contexts = this.appDataService.public.contexts.filter(context => !context.hidden);

if (this.context_id) {
context = this.appDataService.public.contexts.find(context => context.id === this.context_id);
if (this.appDataService.context_id) {
context = this.appDataService.public.contexts.find(context => context.id === this.appDataService.context_id);
} else if (this.selectable_contexts.length === 1) {
context = this.selectable_contexts[0];
}
Expand Down

0 comments on commit fae3df9

Please sign in to comment.