Browse Source

Fix setting chat reactions

master
Eduard Kuzmenko 3 years ago
parent
commit
abb1c021f6
  1. 4
      src/components/sidebarRight/tabs/chatReactions.ts
  2. 3
      src/components/sidebarRight/tabs/editChat.ts

4
src/components/sidebarRight/tabs/chatReactions.ts

@ -84,10 +84,10 @@ export default class AppChatReactionsTab extends SliderSuperTabEventable { @@ -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();
}
});

3
src/components/sidebarRight/tabs/editChat.ts

@ -150,7 +150,8 @@ export default class AppEditChatTab extends SliderSuperTab { @@ -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…
Cancel
Save