This commit is contained in:
Will Hunt
2024-11-04 12:43:59 +00:00
parent d251af4e6d
commit c64c4e61d7
4 changed files with 13 additions and 17 deletions

View File

@@ -189,11 +189,13 @@ export const InCallView: FC<InCallViewProps> = ({
const reactionsIcons = useMemo(
() =>
shouldShowReactions ? Object.entries(reactions).map(([sender, { emoji }]) => ({
sender,
emoji,
startX: -Math.ceil(Math.random() * 50) - 25,
})) : [],
shouldShowReactions
? Object.entries(reactions).map(([sender, { emoji }]) => ({
sender,
emoji,
startX: -Math.ceil(Math.random() * 50) - 25,
}))
: [],
[shouldShowReactions, reactions],
);

View File

@@ -14,7 +14,9 @@ export function ReactionsAudioRenderer(): ReactNode {
const { reactions } = useReactions();
const [shouldPlay] = useSetting(playReactionsSound);
const expectedReactions = shouldPlay ? [...new Set([...Object.values(reactions)])] : [];
const expectedReactions = shouldPlay
? [...new Set([...Object.values(reactions)])]
: [];
return (
<>
{expectedReactions.map(

View File

@@ -23,15 +23,12 @@ export const PreferencesSettingsTab: FC = () => {
showHandRaisedTimerSetting,
);
const [showReactions, setShowReactions] = useSetting(
showReactionsSetting,
);
const [showReactions, setShowReactions] = useSetting(showReactionsSetting);
const [playReactionsSound, setPlayReactionSound] = useSetting(
playReactionsSoundSetting,
);
const onChangeSetting = useCallback(
(e: ChangeEvent<HTMLInputElement>, fn: (value: boolean) => void) => {
fn(e.target.checked);
@@ -60,9 +57,7 @@ export const PreferencesSettingsTab: FC = () => {
<InputField
id="showReactions"
label={t("settings.preferences_tab.reactions_show_label")}
description={t(
"settings.preferences_tab.reactions_show_description",
)}
description={t("settings.preferences_tab.reactions_show_description")}
type="checkbox"
checked={showReactions}
onChange={(e) => onChangeSetting(e, setShowReactions)}

View File

@@ -90,10 +90,7 @@ export const showHandRaisedTimer = new Setting<boolean>(
false,
);
export const showReactions = new Setting<boolean>(
"reactions-show",
true,
);
export const showReactions = new Setting<boolean>("reactions-show", true);
export const playReactionsSound = new Setting<boolean>(
"reactions-play-sound",