Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

refactor: Replace getter with const in emoji_picker.

Gittenburg9f20fdc87a5c
diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.js
index ba1d9c230ff..363ccf3caaf 100644
--- a/static/js/emoji_picker.js
+++ b/static/js/emoji_picker.js
@@ -28,21 +28,19 @@ const search_results = [];
let section_head_offsets = [];
let edit_message_id = null;
-function get_all_emoji_categories() {
- return [
- { name: "Popular", icon: "fa-star-o" },
- { name: "Smileys & Emotion", icon: "fa-smile-o" },
- { name: "People & Body", icon: "fa-thumbs-o-up" },
- { name: "Animals & Nature", icon: "fa-leaf" },
- { name: "Food & Drink", icon: "fa-cutlery" },
- { name: "Activities", icon: "fa-soccer-ball-o" },
- { name: "Travel & Places", icon: "fa-car" },
- { name: "Objects", icon: "fa-lightbulb-o" },
- { name: "Symbols", icon: "fa-hashtag" },
- { name: "Flags", icon: "fa-flag" },
- { name: "Custom", icon: "fa-cog" },
- ];
-}
+const EMOJI_CATEGORIES = [
+ { name: "Popular", icon: "fa-star-o" },
+ { name: "Smileys & Emotion", icon: "fa-smile-o" },
+ { name: "People & Body", icon: "fa-thumbs-o-up" },
+ { name: "Animals & Nature", icon: "fa-leaf" },
+ { name: "Food & Drink", icon: "fa-cutlery" },
+ { name: "Activities", icon: "fa-soccer-ball-o" },
+ { name: "Travel & Places", icon: "fa-car" },
+ { name: "Objects", icon: "fa-lightbulb-o" },
+ { name: "Symbols", icon: "fa-hashtag" },
+ { name: "Flags", icon: "fa-flag" },
+ { name: "Custom", icon: "fa-cog" },
+];
function get_total_sections() {
if (search_is_active) {
@@ -133,7 +131,7 @@ exports.generate_emoji_picker_data = function (realm_emojis) {
}
catalog.set("Popular", popular);
- const categories = get_all_emoji_categories().filter((category) => catalog.has(category.name));
+ const categories = EMOJI_CATEGORIES.filter((category) => catalog.has(category.name));
exports.complete_emoji_catalog = categories.map((category) => ({
name: category.name,
icon: category.icon,