Fix setting chat reactions
This commit is contained in:
parent
9f4fbab03f
commit
abb1c021f6
@ -84,10 +84,10 @@ export default class AppChatReactionsTab extends SliderSuperTabEventable {
|
||||
|
||||
this.listenerSetter.add(toggleRow.checkboxField.input)('change', () => {
|
||||
if(!toggleCheckboxField.checked) {
|
||||
checkboxFields.forEach(checkboxField => checkboxField.setValueSilently(false));
|
||||
checkboxFields.forEach(checkboxField => checkboxField.checked = false);
|
||||
saveReactionsDebounced();
|
||||
} else if(checkboxFields.every(checkboxField => !checkboxField.checked)) {
|
||||
checkboxFields.forEach(checkboxField => checkboxField.setValueSilently(true));
|
||||
checkboxFields.forEach(checkboxField => checkboxField.checked = true);
|
||||
saveReactionsDebounced();
|
||||
}
|
||||
});
|
||||
|
@ -150,7 +150,8 @@ export default class AppEditChatTab extends SliderSuperTab {
|
||||
const availableReactions = await appReactionsManager.getAvailableReactions();
|
||||
const availableReactionsLength = availableReactions.filter(availableReaction => !availableReaction.pFlags.inactive).length;
|
||||
const setReactionsLength = () => {
|
||||
reactionsRow.subtitle.innerHTML = chatFull.available_reactions.length + '/' + availableReactionsLength;
|
||||
const reactions = chatFull.available_reactions ?? [];
|
||||
reactionsRow.subtitle.innerHTML = reactions.length + '/' + availableReactionsLength;
|
||||
};
|
||||
|
||||
setReactionsLength();
|
||||
|
Loading…
x
Reference in New Issue
Block a user