aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2021-08-15 00:03:31 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-09-18 13:19:50 -0400
commit99a368dbb3359c7aeb8aa8fc328c39fc913304d3 (patch)
tree8533e33d1df65dea8a4d62519170b07564a2a011
parentba1b006e05ef50c7e85f88c3dbd4eefc66d05806 (diff)
Load emoji properly on first showing
-rw-r--r--src/components/emoji_picker/emoji_picker.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index cab952f8..322bb8ba 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -58,7 +58,8 @@ const EmojiPicker = {
customEmojiBufferSlice: LOAD_EMOJI_BY,
customEmojiTimeout: null,
customEmojiLoadAllConfirmed: false,
- groupLoadedCount: {}
+ groupLoadedCount: {},
+ firstLoaded: false
}
},
components: {
@@ -167,6 +168,13 @@ const EmojiPicker = {
}
this.$nextTick(() => {
this.$refs['emoji-groups'].scrollTop = 0
+ this.$nextTick(() => {
+ if (this.firstLoaded) {
+ return
+ }
+ this.triggerLoadMore(this.$refs['emoji-groups'])
+ this.firstLoaded = true
+ })
})
const bufferSize = this.customEmojiBuffer.length
const bufferPrefilledAll = bufferSize === this.filteredEmoji.length