fix: use settings from reactionPicker for non-reaction emoji picker

This commit is contained in:
Lhcfl 2024-04-20 01:03:22 +08:00
parent c6e2776298
commit 207855b0e8
4 changed files with 7 additions and 13 deletions

View File

@ -231,15 +231,9 @@ const unicodeEmojiSkinToneLabels = [
i18n.ts._skinTones?.dark ?? "Dark",
];
const size = computed(() =>
props.asReactionPicker ? reactionPickerSize.value : 1,
);
const width = computed(() =>
props.asReactionPicker ? reactionPickerWidth.value : 3,
);
const height = computed(() =>
props.asReactionPicker ? reactionPickerHeight.value : 2,
);
const size = reactionPickerSize;
const width = reactionPickerWidth;
const height = reactionPickerHeight;
const customEmojiCategories = emojiCategories;
const customEmojis = instance.emojis;
const q = ref<string | null>(null);

View File

@ -39,7 +39,7 @@ import { defaultStore } from "@/store";
withDefaults(
defineProps<{
manualShowing?: boolean | null;
src?: HTMLElement;
src?: HTMLElement | null;
showPinned?: boolean;
asReactionPicker?: boolean;
}>(),

View File

@ -1188,7 +1188,7 @@ async function insertEmoji(ev: MouseEvent) {
os.openEmojiPicker(
(ev.currentTarget ?? ev.target) as HTMLElement,
{},
textareaEl.value,
textareaEl.value!,
);
}

View File

@ -24,14 +24,14 @@ class ReactionPicker {
},
{
done: (reaction) => {
this.onChosen!(reaction);
this.onChosen?.(reaction);
},
close: () => {
this.manualShowing.value = false;
},
closed: () => {
this.src.value = null;
this.onClosed!();
this.onClosed?.();
},
},
);