fix(aio): disable search on browsers that don't support web workers

This commit is contained in:
Igor Minar 2017-05-31 05:18:49 -05:00 committed by Igor Minar
parent 9326e062d8
commit 11505fa0d8
1 changed files with 5 additions and 2 deletions

View File

@ -108,8 +108,11 @@ export class AppComponent implements OnInit {
) { }
ngOnInit() {
this.searchService.initWorker('app/search/search-worker.js');
this.searchService.loadIndex();
// Do not initialize the search on browsers that lack web worker support
if ('worker' in window) {
this.searchService.initWorker('app/search/search-worker.js');
this.searchService.loadIndex();
}
this.onResize(window.innerWidth);