Skip to content

Commit

Permalink
fix(startup-message): Fix message doesn't show when context loaded by…
Browse files Browse the repository at this point in the history
… url (#253)

* Startup message from context

* Fix message doesn't show when context loaded by url
  • Loading branch information
ameliebernier authored and mbarbeau committed Mar 27, 2019
1 parent 8f16a3d commit 893a892
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/pages/portal/portal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class PortalComponent implements OnInit, OnDestroy {
}

private handleContextChange(context: Context) {

if (context !== undefined && this.contextLoaded) {
const tool = this.toolService.getTool('mapDetails');
this.toolService.selectTool(tool);
Expand All @@ -241,6 +242,15 @@ export class PortalComponent implements OnInit, OnDestroy {

if (context !== undefined) {
this.contextLoaded = true;

const message = context['message'];
if (message) {
this.contextMessage = this.messageService.message(<Message>message);
} else {
if (this.contextMessage) {
this.messageService.remove(this.contextMessage.id);
}
}
}

this.route.queryParams.subscribe(params => {
Expand Down

0 comments on commit 893a892

Please sign in to comment.