Theme fix for emoji picker popup

This commit is contained in:
Noah 2024-04-06 16:59:23 -07:00
parent a0786b2fa9
commit 93c4e12680
2 changed files with 12 additions and 3 deletions

View File

@ -4371,7 +4371,7 @@ export default {
label on the chat history panel -->
<div class="dropdown-content p-0">
<EmojiPicker :native="true" :display-recent="true" :disable-skin-tones="true"
theme="auto" @select="onSelectEmoji">
:theme="prefs.theme !== 'auto' ? prefs.theme : 'auto'" @select="onSelectEmoji">
</EmojiPicker>
</div>
</div>

View File

@ -1,5 +1,6 @@
<script>
import EmojiPicker from 'vue3-emoji-picker';
import LocalStorage from '../lib/LocalStorage';
import 'vue3-emoji-picker/css';
export default {
@ -81,7 +82,15 @@ export default {
// Compactify a message (remove paragraph breaks added by Markdown renderer)
compactMessage() {
return this.message.message.replace(/<\/p>\s*<p>/g, "<br><br>").replace(/<\/?p>/g, "");
}
},
emojiPickerTheme() {
let theme = LocalStorage.get('theme');
if (theme === 'light' || theme === 'dark') {
return theme;
}
return 'auto';
},
},
methods: {
openProfile() {
@ -332,7 +341,7 @@ export default {
<!-- Emoji reactions menu -->
<EmojiPicker v-if="showEmojiPicker" :native="true" :display-recent="true" :disable-skin-tones="true"
:additional-groups="customEmojiGroups" :group-names="{ frequently_used: 'Frequently Used' }"
theme="auto" @select="onSelectEmoji"></EmojiPicker>
:theme="emojiPickerTheme" @select="onSelectEmoji"></EmojiPicker>
</div>
</div>
</div>