Skip to content

Commit

Permalink
fix: enable travel aid toggle regardless of stop button config
Browse files Browse the repository at this point in the history
  • Loading branch information
rosvik committed Nov 18, 2024
1 parent 2b66e79 commit 5a54e38
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@atb/components/sections';
import {Button} from '@atb/components/button';
import {usePreferences} from '@atb/preferences';
import {useRemoteConfig} from '@atb/RemoteConfigContext';
import Bugsnag from '@bugsnag/react-native';
import {useFirestoreConfiguration} from '@atb/configuration';
import {useAnalytics} from '@atb/analytics';
Expand All @@ -22,7 +21,6 @@ export const Profile_TravelAidScreen = () => {
const styles = useStyles();
const {t} = useTranslation();
const {theme} = useTheme();
const {enable_travel_aid_stop_button} = useRemoteConfig();
const {setPreference, preferences} = usePreferences();
const {contactPhoneNumber} = useFirestoreConfiguration();
const analytics = useAnalytics();
Expand All @@ -34,10 +32,6 @@ export const Profile_TravelAidScreen = () => {
const travelAidToggleTitle = t(TravelAidSettingsTexts.toggle.title);
const travelAidSubtext = t(TravelAidSettingsTexts.toggle.subText);

const toggleValue = !enable_travel_aid_stop_button
? false
: preferences.journeyAidEnabled;

return (
<FullScreenView
headerProps={{
Expand All @@ -55,7 +49,7 @@ export const Profile_TravelAidScreen = () => {
<Section>
<ToggleSectionItem
text={travelAidToggleTitle}
value={toggleValue}
value={preferences.journeyAidEnabled}
onValueChange={(checked) => {
analytics.logEvent(
'Journey aid',
Expand All @@ -68,7 +62,6 @@ export const Profile_TravelAidScreen = () => {
setPreference({journeyAidEnabled: checked});
}}
subtext={travelAidSubtext}
disabled={!enable_travel_aid_stop_button}
isSubtextMarkdown
testID="toggleTravelAid"
/>
Expand Down

0 comments on commit 5a54e38

Please sign in to comment.