forked from FoundKeyGang/FoundKey
最近使用した絵文字からリアクションピッカーに設定してある絵文字は除外するように
This commit is contained in:
parent
4299e3f90c
commit
c6a009dbae
2 changed files with 10 additions and 7 deletions
|
@ -32,7 +32,7 @@
|
||||||
<div class="index">
|
<div class="index">
|
||||||
<section>
|
<section>
|
||||||
<div>
|
<div>
|
||||||
<button v-for="emoji in reactions || $store.state.settings.reactions"
|
<button v-for="emoji in pinned"
|
||||||
class="_button"
|
class="_button"
|
||||||
@click="chosen(emoji, $event)"
|
@click="chosen(emoji, $event)"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
@ -109,7 +109,7 @@ export default defineComponent({
|
||||||
src: {
|
src: {
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
reactions: {
|
overridePinned: {
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -120,6 +120,7 @@ export default defineComponent({
|
||||||
return {
|
return {
|
||||||
emojilist: markRaw(emojilist),
|
emojilist: markRaw(emojilist),
|
||||||
getStaticImageUrl,
|
getStaticImageUrl,
|
||||||
|
pinned: this.overridePinned || this.$store.state.settings.reactions,
|
||||||
customEmojiCategories: this.$store.getters['instance/emojiCategories'],
|
customEmojiCategories: this.$store.getters['instance/emojiCategories'],
|
||||||
customEmojis: this.$store.state.instance.meta.emojis,
|
customEmojis: this.$store.state.instance.meta.emojis,
|
||||||
visibleCategories: {},
|
visibleCategories: {},
|
||||||
|
@ -334,10 +335,12 @@ export default defineComponent({
|
||||||
this.$refs.modal.close();
|
this.$refs.modal.close();
|
||||||
|
|
||||||
// 最近使った絵文字更新
|
// 最近使った絵文字更新
|
||||||
|
if (!this.pinned.includes(key)) {
|
||||||
let recents = this.$store.state.device.recentlyUsedEmojis;
|
let recents = this.$store.state.device.recentlyUsedEmojis;
|
||||||
recents = recents.filter((e: any) => e !== key);
|
recents = recents.filter((e: any) => e !== key);
|
||||||
recents.unshift(key);
|
recents.unshift(key);
|
||||||
this.$store.commit('device/set', { key: 'recentlyUsedEmojis', value: recents.splice(0, 16) });
|
this.$store.commit('device/set', { key: 'recentlyUsedEmojis', value: recents.splice(0, 16) });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
paste(event) {
|
paste(event) {
|
||||||
|
|
|
@ -82,7 +82,7 @@ export default defineComponent({
|
||||||
preview(ev) {
|
preview(ev) {
|
||||||
if (this.$store.state.device.useFullReactionPicker) {
|
if (this.$store.state.device.useFullReactionPicker) {
|
||||||
os.popup(import('@/components/emoji-picker.vue'), {
|
os.popup(import('@/components/emoji-picker.vue'), {
|
||||||
reactions: this.splited,
|
overridePinned: this.splited,
|
||||||
src: ev.currentTarget || ev.target,
|
src: ev.currentTarget || ev.target,
|
||||||
}, {}, 'closed');
|
}, {}, 'closed');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue