From 3e5e7a0b19e4baad4fc764d73aaeef1e30993b71 Mon Sep 17 00:00:00 2001 From: Harshit Bansal Date: Tue, 14 Aug 2018 12:05:46 +0000 Subject: [PATCH] emoji: Pre-fetch octopus emoji in `emoji.js`. If we don't prefetch the image then on slow networks it will appear as if octopus emoji is not present. --- static/js/emoji.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/static/js/emoji.js b/static/js/emoji.js index d8e8857dd9..a76d553949 100644 --- a/static/js/emoji.js +++ b/static/js/emoji.js @@ -93,10 +93,12 @@ exports.initialize = function initialize() { // prefetching for that case. emojiset = 'google'; } - // Load the sprite image in the background so that the browser - // can cache it for later use. + // Load the sprite image and octopus image in the background, so + // that the browser will cache it for later use. var sprite = new Image(); sprite.src = '/static/generated/emoji/sheet_' + emojiset + '_64.png'; + var octopus_image = new Image(); + octopus_image.src = '/static/generated/emoji/images-' + emojiset + '-64/1f419.png'; }; exports.build_emoji_data = function (realm_emojis) {