From 3d282f45fa3160a62234005206f1fffeddf6407b Mon Sep 17 00:00:00 2001 From: Curtis ROck Date: Sun, 6 Sep 2020 05:13:44 -0500 Subject: [PATCH] fixed toggle click state change bug --- app/soapbox/actions/settings.js | 1 - app/soapbox/features/chats/components/audio_toggle.js | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index 7d330219f..097265814 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -33,7 +33,6 @@ const defaultSettings = ImmutableMap({ panes: ImmutableList(), mainWindow: 'minimized', sound: true, - flash: true, }), home: ImmutableMap({ diff --git a/app/soapbox/features/chats/components/audio_toggle.js b/app/soapbox/features/chats/components/audio_toggle.js index 5c1d82e33..9b207273a 100644 --- a/app/soapbox/features/chats/components/audio_toggle.js +++ b/app/soapbox/features/chats/components/audio_toggle.js @@ -36,18 +36,18 @@ class AudioToggle extends React.PureComponent { }; handleToggleAudio = () => { - this.props.toggleAudio(this.props.settings.get('chats', 'sound') === true ? false : true); + this.props.toggleAudio(this.props.settings.getIn(['chats', 'sound']) === true ? false : true); } render() { const { intl, settings, showLabel } = this.props; let toggle = ( - , unchecked: }} ariaLabel={settings.get('chats', 'sound') === 'light' ? intl.formatMessage(messages.switchToOff) : intl.formatMessage(messages.switchToOn)} /> + , unchecked: }} ariaLabel={settings.get('chats', 'sound') === true ? intl.formatMessage(messages.switchToOff) : intl.formatMessage(messages.switchToOn)} /> ); if (showLabel) { toggle = ( - , unchecked: }} label={settings.get('chats', 'sound') === 'light' ? intl.formatMessage(messages.switchToOff) : intl.formatMessage(messages.switchToOn)} /> + , unchecked: }} label={settings.get('chats', 'sound') === true ? intl.formatMessage(messages.switchToOff) : intl.formatMessage(messages.switchToOn)} /> ); }