MOBILE-3068 blocks: Fix resize uncaught promise

main
Pau Ferrer Ocaña 2019-08-21 10:01:49 +02:00
parent 42f44e4945
commit 486e1d9b11
2 changed files with 8 additions and 0 deletions

View File

@ -128,6 +128,8 @@ export class CoreTabComponent implements OnInit, OnDestroy {
});
this.tabs.showHideTabs(scroll);
}).catch(() => {
// Ignore errors.
});
}

View File

@ -67,6 +67,10 @@ export class CoreBlockCourseBlocksComponent implements OnInit, OnDestroy {
* Setup scrolling.
*/
protected initScroll(): void {
if (this.blocks.length <= 0) {
return;
}
const scroll: HTMLElement = this.content && this.content.getScrollElement();
this.domUtils.waitElementToExist(() => scroll && scroll.querySelector('.core-course-blocks-side')).then((sideElement) => {
@ -89,6 +93,8 @@ export class CoreBlockCourseBlocksComponent implements OnInit, OnDestroy {
this.sideScroll.classList.remove('core-course-blocks-fixed-bottom');
this.scrollWorking = false;
}
}).catch(() => {
// Ignore errors.
});
}