This commit is contained in:
samunohito 2023-12-10 20:42:30 +09:00
parent d28a38f6ef
commit 3f97bcecc0
3 changed files with 10 additions and 7 deletions

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<div class="_gaps_m"> <div class="_gaps_m">
<FormSection first="true"> <FormSection :first="true">
<template #label>{{ i18n.ts.reactionDeckSettingTitle }}</template> <template #label>{{ i18n.ts.reactionDeckSettingTitle }}</template>
<template #description>{{ i18n.ts.reactionDeckSettingDescription }}</template> <template #description>{{ i18n.ts.reactionDeckSettingDescription }}</template>

View File

@ -24,20 +24,23 @@ class EmojiPicker {
// nop // nop
} }
/**
* {@link ComputedRef}
*/
private createDeckItemCompute(): ComputedRef<string[]> { private createDeckItemCompute(): ComputedRef<string[]> {
const itemPresetType = this.itemPresetType; const itemPresetTypeRef = this.itemPresetType;
const useReactionDeckItems = defaultStore.reactiveState.useReactionDeckItems; const useReactionDeckItemsRef = defaultStore.reactiveState.useReactionDeckItems;
const reactionsRef = defaultStore.reactiveState.reactions; const reactionsRef = defaultStore.reactiveState.reactions;
const emojisRef = defaultStore.reactiveState.emojiDeckItems; const emojisRef = defaultStore.reactiveState.emojiDeckItems;
return computed(() => { return computed(() => {
switch (itemPresetType.value) { switch (itemPresetTypeRef.value) {
case 'reactions': case 'reactions':
return reactionsRef.value; return reactionsRef.value;
case 'emojis': case 'emojis':
return emojisRef.value; return emojisRef.value;
default: default:
return useReactionDeckItems.value ? reactionsRef.value : emojisRef.value; return useReactionDeckItemsRef.value ? reactionsRef.value : emojisRef.value;
} }
}); });
} }

View File

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