Lint fixes
This commit is contained in:
parent
35b12d9b72
commit
1464167e6b
1 changed files with 4 additions and 1 deletions
|
@ -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)));
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue