From 8592f6a941620463f8723dfe0e5329416d447f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 9 Apr 2019 14:08:06 +0100 Subject: [PATCH] fix(ui): don't error on font load timeout --- ui/src/Components/Grid/AlertGrid/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/Components/Grid/AlertGrid/index.js b/ui/src/Components/Grid/AlertGrid/index.js index 837a56f10..6d2e498ae 100644 --- a/ui/src/Components/Grid/AlertGrid/index.js +++ b/ui/src/Components/Grid/AlertGrid/index.js @@ -154,12 +154,13 @@ const AlertGrid = observer( const font400 = new FontFaceObserver("Lato", { weight: 400 }); - font400.load().then(this.masonryRepack); + // wait up to 30s, run no-op function on timeout + font400.load(null, 30000).then(this.masonryRepack, () => {}); const font700 = new FontFaceObserver("Lato", { weight: 700 }); - font700.load().then(this.masonryRepack); + font700.load(null, 30000).then(this.masonryRepack, () => {}); } componentDidUpdate() {