First pass at the emoji picker
This commit is contained in:
Gabe Kangas
2022-05-26 18:59:16 -07:00
parent 1d213b71d4
commit 8ed01ed4da
7 changed files with 80 additions and 47 deletions

View File

@@ -14,8 +14,10 @@ import (
log "github.com/sirupsen/logrus"
)
var emojiCache = make([]models.CustomEmoji, 0)
var emojiCacheTimestamp time.Time
var (
emojiCache = make([]models.CustomEmoji, 0)
emojiCacheTimestamp time.Time
)
// getCustomEmojiList returns a list of custom emoji either from the cache or from the emoji directory.
func getCustomEmojiList() []models.CustomEmoji {
@@ -38,7 +40,7 @@ func getCustomEmojiList() []models.CustomEmoji {
for _, f := range files {
name := strings.TrimSuffix(f.Name(), path.Ext(f.Name()))
emojiPath := filepath.Join(config.EmojiDir, f.Name())
singleEmoji := models.CustomEmoji{Name: name, Emoji: emojiPath}
singleEmoji := models.CustomEmoji{Name: name, URL: emojiPath}
emojiCache = append(emojiCache, singleEmoji)
}