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>
<div class="_gaps_m">
<FormSection first="true">
<FormSection :first="true">
<template #label>{{ i18n.ts.reactionDeckSettingTitle }}</template>
<template #description>{{ i18n.ts.reactionDeckSettingDescription }}</template>

View File

@ -24,20 +24,23 @@ class EmojiPicker {
// nop
}
/**
* {@link ComputedRef}
*/
private createDeckItemCompute(): ComputedRef<string[]> {
const itemPresetType = this.itemPresetType;
const useReactionDeckItems = defaultStore.reactiveState.useReactionDeckItems;
const itemPresetTypeRef = this.itemPresetType;
const useReactionDeckItemsRef = defaultStore.reactiveState.useReactionDeckItems;
const reactionsRef = defaultStore.reactiveState.reactions;
const emojisRef = defaultStore.reactiveState.emojiDeckItems;
return computed(() => {
switch (itemPresetType.value) {
switch (itemPresetTypeRef.value) {
case 'reactions':
return reactionsRef.value;
case 'emojis':
return emojisRef.value;
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,
}, {
done: reaction => {
this.onChosen!(reaction);
if (this.onChosen) this.onChosen(reaction);
},
close: () => {
this.manualShowing.value = false;
},
closed: () => {
this.src.value = null;
this.onClosed!();
if (this.onClosed) this.onClosed();
},
});
}