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.
This commit is contained in:
Harshit Bansal
2018-08-14 12:05:46 +00:00
committed by Tim Abbott
parent 7be7561c68
commit 3e5e7a0b19

View File

@@ -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) {