emoji: Fix caching for text emojiset.

This commit removes an early exit that was causing spritesheets to
not get cached for fallback emojiset in case of text emojiset.
This commit is contained in:
Harshit Bansal 2018-08-31 18:36:03 +00:00 committed by Tim Abbott
parent 20aee7b116
commit 400bb6ca48
1 changed files with 7 additions and 4 deletions

View File

@ -158,18 +158,21 @@ exports.report_emojiset_change = function () {
}
}
var emojiset = page_params.emojiset;
if (page_params.emojiset === 'text') {
emoji_success();
return;
// For `text` emojiset we fallback to `google-blob` emojiset
// for displaying emojis in emoji picker and typeahead.
emojiset = 'google-blob';
}
var sprite = new Image();
sprite.onload = function () {
var sprite_css_href = "/static/generated/emoji/" + page_params.emojiset + "-sprite.css";
var sprite_css_href = "/static/generated/emoji/" + emojiset + "-sprite.css";
$("#emoji-spritesheet").attr('href', sprite_css_href);
emoji_success();
};
sprite.src = "/static/generated/emoji/sheet-" + page_params.emojiset + "-64.png";
sprite.src = "/static/generated/emoji/sheet-" + emojiset + "-64.png";
};
exports.update_page = function () {