Skip to content

Commit

Permalink
fix(search): fix unsubcribe issue that prevented the lib from working
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourget committed May 5, 2017
1 parent bea2ea0 commit 9d302a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/search/search-bar/search-url-param.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export class SearchUrlParamDirective implements OnInit {
ngOnInit() {
const queryParams$$ = this.route.queryParams
.subscribe(params => {
queryParams$$.unsubscribe();
if (queryParams$$ !== undefined) {
queryParams$$.unsubscribe();
}
if (params['search']) {
this.component.setTerm(params['search']);
}
Expand Down

0 comments on commit 9d302a1

Please sign in to comment.