From 1464167e6b8803831ef92618788ab99743cf761f Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 27 Jun 2019 15:45:28 -0700 Subject: [PATCH] Lint fixes --- ts/components/emoji/lib.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ts/components/emoji/lib.ts b/ts/components/emoji/lib.ts index e3bb16f814..388e90beb8 100644 --- a/ts/components/emoji/lib.ts +++ b/ts/components/emoji/lib.ts @@ -76,13 +76,14 @@ const images = new Set(); export const preloadImages = async () => { // Preload images - const preload = (src: string) => + const preload = async (src: string) => new Promise((resolve, reject) => { const img = new Image(); img.onload = resolve; img.onerror = reject; img.src = src; images.add(img); + // tslint:disable-next-line no-string-based-set-timeout setTimeout(reject, 5000); }); @@ -91,10 +92,12 @@ export const preloadImages = async () => { const start = Date.now(); data.forEach(emoji => { + // tslint:disable-next-line no-floating-promises promise-function-async imageQueue.add(() => preload(makeImagePath(emoji.image))); if (emoji.skin_variations) { Object.values(emoji.skin_variations).forEach(variation => { + // tslint:disable-next-line no-floating-promises promise-function-async imageQueue.add(() => preload(makeImagePath(variation.image))); }); }