From 9bbc2e77e13fd64c9ca69ba1480a4910dc961cf9 Mon Sep 17 00:00:00 2001 From: Tsubasa SEKIGUCHI Date: Tue, 6 Aug 2024 19:01:27 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=A7=E6=A8=99=E3=81=AE=E6=AF=94?= =?UTF-8?q?=E8=BC=83=E3=81=A7=E3=81=AF=E3=81=AA=E3=81=8F=E3=82=BF=E3=82=A4?= =?UTF-8?q?=E3=83=A0=E3=82=B9=E3=82=BF=E3=83=B3=E3=83=97=E3=81=AE=E6=AF=94?= =?UTF-8?q?=E8=BC=83(30=E7=A7=92=E6=AF=8E)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/location.ts | 4 +--- src/hooks/useLocationStore.ts | 14 +++++++----- .../useStartBackgroundLocationUpdates.ts | 3 +-- src/index.tsx | 22 +++++++++++++++++++ src/screens/Main.tsx | 21 ------------------ 5 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/constants/location.ts b/src/constants/location.ts index ce88527b0..ada8a8b15 100644 --- a/src/constants/location.ts +++ b/src/constants/location.ts @@ -4,6 +4,4 @@ export const LOCATION_TASK_NAME_CANARY = // デフォルトの端末上の駅直線距離計算誤差(meter) // 位置情報の処理間隔(meter) -export const DISTANCE_FILTER_LOW = 300 -export const DISTANCE_FILTER_BALANCED = 150 -export const DISTANCE_FILTER_HIGH = 100 +export const MINIMUM_UPDATE_INTERVAL = 30 * 1000 diff --git a/src/hooks/useLocationStore.ts b/src/hooks/useLocationStore.ts index 1940b050d..ddf5d8a87 100644 --- a/src/hooks/useLocationStore.ts +++ b/src/hooks/useLocationStore.ts @@ -1,5 +1,6 @@ import { LocationObject } from 'expo-location' import { create } from 'zustand' +import { MINIMUM_UPDATE_INTERVAL } from '../constants/location' export const useLocationStore = create(() => null) @@ -9,11 +10,14 @@ export const setLocation = (location: LocationObject) => return location } - const { latitude: inputLat, longitude: inputLon } = location.coords - const { latitude: stateLat, longitude: stateLon } = state.coords - if (inputLat === stateLat && inputLon === stateLon) { - return state + const { timestamp: inputTimestamp } = location + const { timestamp: stateTimestamp } = state + + const diffInMs = inputTimestamp - stateTimestamp + + if (diffInMs > MINIMUM_UPDATE_INTERVAL) { + return { ...state, ...location } } - return location + return state }) diff --git a/src/hooks/useStartBackgroundLocationUpdates.ts b/src/hooks/useStartBackgroundLocationUpdates.ts index c46717fba..483a7f98e 100644 --- a/src/hooks/useStartBackgroundLocationUpdates.ts +++ b/src/hooks/useStartBackgroundLocationUpdates.ts @@ -1,5 +1,4 @@ import * as Location from 'expo-location' -import * as TaskManager from 'expo-task-manager' import { useEffect } from 'react' import { useRecoilValue } from 'recoil' import { autoModeEnabledSelector } from '../store/selectors/autoMode' @@ -24,7 +23,7 @@ export const useStartBackgroundLocationUpdates = () => { }) return () => { - TaskManager.unregisterTaskAsync(locationTaskName) + Location.stopLocationUpdatesAsync(locationTaskName) } // eslint-disable-next-line react-hooks/exhaustive-deps }, []) diff --git a/src/index.tsx b/src/index.tsx index 6d40ab2f7..cb5c37bef 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,6 +3,7 @@ import remoteConfig from '@react-native-firebase/remote-config' import { NavigationContainer } from '@react-navigation/native' import { createStackNavigator } from '@react-navigation/stack' import * as Location from 'expo-location' +import * as TaskManager from 'expo-task-manager' import React, { ErrorInfo, useCallback, useEffect, useState } from 'react' import { ErrorBoundary } from 'react-error-boundary' import { ActivityIndicator, StatusBar, StyleSheet, Text } from 'react-native' @@ -11,11 +12,32 @@ import ErrorFallback from './components/ErrorBoundary' import FakeStationSettings from './components/FakeStationSettings' import TuningSettings from './components/TuningSettings' import useAnonymousUser from './hooks/useAnonymousUser' +import { setLocation } from './hooks/useLocationStore' import useReport from './hooks/useReport' import PrivacyScreen from './screens/Privacy' import SavedRoutesScreen from './screens/SavedRoutesScreen' import MainStack from './stacks/MainStack' import { setI18nConfig } from './translation' +import { locationTaskName } from './utils/locationTaskName' + +TaskManager.defineTask( + locationTaskName, + ({ + data, + error, + }: { + data: { locations: Location.LocationObject[] } + error: TaskManager.TaskManagerError | null + }) => { + if (error) { + console.error(error) + return + } + + setLocation(data.locations[0]) + } +) +TaskManager.unregisterTaskAsync(locationTaskName) const Stack = createStackNavigator() diff --git a/src/screens/Main.tsx b/src/screens/Main.tsx index 9747299db..2c7cc5606 100644 --- a/src/screens/Main.tsx +++ b/src/screens/Main.tsx @@ -2,8 +2,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage' import { useNavigation } from '@react-navigation/native' import { useKeepAwake } from 'expo-keep-awake' import * as Linking from 'expo-linking' -import { LocationObject } from 'expo-location' -import * as TaskManager from 'expo-task-manager' import React, { useCallback, useEffect, useMemo, useRef } from 'react' import { Alert, @@ -24,7 +22,6 @@ import { ASYNC_STORAGE_KEYS } from '../constants' import useAutoMode from '../hooks/useAutoMode' import { useCurrentLine } from '../hooks/useCurrentLine' import { useCurrentStation } from '../hooks/useCurrentStation' -import { setLocation } from '../hooks/useLocationStore' import { useLoopLine } from '../hooks/useLoopLine' import { useNextStation } from '../hooks/useNextStation' import useRefreshLeftStations from '../hooks/useRefreshLeftStations' @@ -45,24 +42,6 @@ import { translate } from '../translation' import getCurrentStationIndex from '../utils/currentStationIndex' import { getIsHoliday } from '../utils/isHoliday' import getIsPass from '../utils/isPass' -import { locationTaskName } from '../utils/locationTaskName' - -TaskManager.defineTask( - locationTaskName, - ({ - data, - error, - }: { - data: { locations: LocationObject[] } - error: TaskManager.TaskManagerError | null - }) => { - if (error) { - console.error(error) - return - } - setLocation(data.locations[0]) - } -) const { height: windowHeight } = Dimensions.get('window') From 8f3f57b646780665af20c827e70de14d0c5c57e6 Mon Sep 17 00:00:00 2001 From: Tsubasa SEKIGUCHI Date: Wed, 7 Aug 2024 23:10:21 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E5=9C=B0=E4=B8=8B=E9=89=84=E3=81=A7?= =?UTF-8?q?=E6=9A=B4=E8=B5=B0=E3=81=AF=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=B8=80=E6=97=A6=E4=BC=91?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/location.ts | 4 ++-- src/hooks/useLocationStore.ts | 2 +- src/hooks/useStartBackgroundLocationUpdates.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/constants/location.ts b/src/constants/location.ts index ada8a8b15..c218170bf 100644 --- a/src/constants/location.ts +++ b/src/constants/location.ts @@ -2,6 +2,6 @@ export const LOCATION_TASK_NAME_PROD = 'trainlcd-background-location-task' export const LOCATION_TASK_NAME_CANARY = 'trainlcd-canary-background-location-task' // デフォルトの端末上の駅直線距離計算誤差(meter) -// 位置情報の処理間隔(meter) +// 位置情報理間隔(meter) -export const MINIMUM_UPDATE_INTERVAL = 30 * 1000 +export const MINIMUM_UPDATE_INTERVAL = 3 * 1000 diff --git a/src/hooks/useLocationStore.ts b/src/hooks/useLocationStore.ts index ddf5d8a87..91316d24c 100644 --- a/src/hooks/useLocationStore.ts +++ b/src/hooks/useLocationStore.ts @@ -16,7 +16,7 @@ export const setLocation = (location: LocationObject) => const diffInMs = inputTimestamp - stateTimestamp if (diffInMs > MINIMUM_UPDATE_INTERVAL) { - return { ...state, ...location } + return location } return state diff --git a/src/hooks/useStartBackgroundLocationUpdates.ts b/src/hooks/useStartBackgroundLocationUpdates.ts index 483a7f98e..c46717fba 100644 --- a/src/hooks/useStartBackgroundLocationUpdates.ts +++ b/src/hooks/useStartBackgroundLocationUpdates.ts @@ -1,4 +1,5 @@ import * as Location from 'expo-location' +import * as TaskManager from 'expo-task-manager' import { useEffect } from 'react' import { useRecoilValue } from 'recoil' import { autoModeEnabledSelector } from '../store/selectors/autoMode' @@ -23,7 +24,7 @@ export const useStartBackgroundLocationUpdates = () => { }) return () => { - Location.stopLocationUpdatesAsync(locationTaskName) + TaskManager.unregisterTaskAsync(locationTaskName) } // eslint-disable-next-line react-hooks/exhaustive-deps }, []) From 48173325bdc6b307ebab8b32de641011d76f887d Mon Sep 17 00:00:00 2001 From: Tsubasa SEKIGUCHI Date: Thu, 8 Aug 2024 01:08:40 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9A=B4=E8=B5=B0=E3=81=8C=E5=86=8D?= =?UTF-8?q?=E7=8F=BE=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 3 +- src/components/Permitted.tsx | 9 ++++-- src/constants/location.ts | 4 --- src/constants/state.ts | 1 - src/hooks/useApplicationFlagStore.ts | 12 ++++++++ src/hooks/useLocationStore.ts | 18 +----------- .../useStartBackgroundLocationUpdates.ts | 10 ++----- src/index.tsx | 22 -------------- src/screens/Main.tsx | 29 ++++++++++++++++++- src/screens/SelectBound.tsx | 25 +++++++--------- src/store/atoms/navigation.ts | 2 -- src/store/selectors/autoMode.ts | 8 ----- 12 files changed, 63 insertions(+), 80 deletions(-) create mode 100644 src/hooks/useApplicationFlagStore.ts delete mode 100644 src/store/selectors/autoMode.ts diff --git a/index.js b/index.js index 9f1ebf53e..888cff8cf 100644 --- a/index.js +++ b/index.js @@ -3,9 +3,8 @@ import 'fast-text-encoding' import { registerRootComponent } from 'expo' import * as TaskManager from 'expo-task-manager' import App from './src' -import { locationTaskName } from './src/utils/locationTaskName' -TaskManager.unregisterTaskAsync(locationTaskName).catch(console.debug) +TaskManager.unregisterAllTasksAsync().catch(console.error) // registerRootComponent calls AppRegistry.registerComponent('main', () => App); // It also ensures that whether you load the app in the Expo client or in a native build, diff --git a/src/components/Permitted.tsx b/src/components/Permitted.tsx index 8dc585146..4116558c2 100644 --- a/src/components/Permitted.tsx +++ b/src/components/Permitted.tsx @@ -9,7 +9,7 @@ import RNFS from 'react-native-fs' import { LongPressGestureHandler, State } from 'react-native-gesture-handler' import Share from 'react-native-share' import ViewShot from 'react-native-view-shot' -import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' +import { useRecoilValue, useSetRecoilState } from 'recoil' import { ALL_AVAILABLE_LANGUAGES, ASYNC_STORAGE_KEYS, @@ -18,6 +18,7 @@ import { } from '../constants' import useAndroidWearable from '../hooks/useAndroidWearable' import useAppleWatch from '../hooks/useAppleWatch' +import { useApplicationFlagStore } from '../hooks/useApplicationFlagStore' import { useBadAccuracy } from '../hooks/useBadAccuracy' import useCachedInitAnonymousUser from '../hooks/useCachedAnonymousUser' import useCheckStoreVersion from '../hooks/useCheckStoreVersion' @@ -69,7 +70,7 @@ const PermittedLayout: React.FC = ({ children }: Props) => { const [longPressNoticeDismissed, setLongPressNoticeDismissed] = useState(true) const { selectedBound } = useRecoilValue(stationState) - const [{ autoModeEnabled }, setNavigation] = useRecoilState(navigationState) + const setNavigation = useSetRecoilState(navigationState) const setSpeech = useSetRecoilState(speechState) const [reportModalShow, setReportModalShow] = useState(false) const [sendingReport, setSendingReport] = useState(false) @@ -77,6 +78,10 @@ const PermittedLayout: React.FC = ({ children }: Props) => { const [screenShotBase64, setScreenShotBase64] = useState('') const [screenshotTaken, setScreenshotTaken] = useState(false) + const autoModeEnabled = useApplicationFlagStore( + (state) => state.autoModeEnabled + ) + useCheckStoreVersion() useAppleWatch() useAndroidWearable() diff --git a/src/constants/location.ts b/src/constants/location.ts index c218170bf..406c45bbe 100644 --- a/src/constants/location.ts +++ b/src/constants/location.ts @@ -1,7 +1,3 @@ export const LOCATION_TASK_NAME_PROD = 'trainlcd-background-location-task' export const LOCATION_TASK_NAME_CANARY = 'trainlcd-canary-background-location-task' -// デフォルトの端末上の駅直線距離計算誤差(meter) -// 位置情報理間隔(meter) - -export const MINIMUM_UPDATE_INTERVAL = 3 * 1000 diff --git a/src/constants/state.ts b/src/constants/state.ts index edd11ca4e..38c7c7258 100644 --- a/src/constants/state.ts +++ b/src/constants/state.ts @@ -12,5 +12,4 @@ export const RECOIL_STATES = { // selectors isEnSelector: 'isEnSelector', - autoModeEnabledSelector: 'autoModeEnabledSelector', } diff --git a/src/hooks/useApplicationFlagStore.ts b/src/hooks/useApplicationFlagStore.ts new file mode 100644 index 000000000..985d51d2d --- /dev/null +++ b/src/hooks/useApplicationFlagStore.ts @@ -0,0 +1,12 @@ +import { create } from 'zustand' + +type State = { + autoModeEnabled: boolean + toggleAutoModeEnabled: () => void +} + +export const useApplicationFlagStore = create((set) => ({ + autoModeEnabled: false, + toggleAutoModeEnabled: () => + set((state) => ({ autoModeEnabled: !state.autoModeEnabled })), +})) diff --git a/src/hooks/useLocationStore.ts b/src/hooks/useLocationStore.ts index 91316d24c..8f7cdbe94 100644 --- a/src/hooks/useLocationStore.ts +++ b/src/hooks/useLocationStore.ts @@ -1,23 +1,7 @@ import { LocationObject } from 'expo-location' import { create } from 'zustand' -import { MINIMUM_UPDATE_INTERVAL } from '../constants/location' export const useLocationStore = create(() => null) export const setLocation = (location: LocationObject) => - useLocationStore.setState((state) => { - if (!state) { - return location - } - - const { timestamp: inputTimestamp } = location - const { timestamp: stateTimestamp } = state - - const diffInMs = inputTimestamp - stateTimestamp - - if (diffInMs > MINIMUM_UPDATE_INTERVAL) { - return location - } - - return state - }) + useLocationStore.setState(location, true) diff --git a/src/hooks/useStartBackgroundLocationUpdates.ts b/src/hooks/useStartBackgroundLocationUpdates.ts index c46717fba..24218510a 100644 --- a/src/hooks/useStartBackgroundLocationUpdates.ts +++ b/src/hooks/useStartBackgroundLocationUpdates.ts @@ -1,15 +1,12 @@ import * as Location from 'expo-location' -import * as TaskManager from 'expo-task-manager' import { useEffect } from 'react' -import { useRecoilValue } from 'recoil' -import { autoModeEnabledSelector } from '../store/selectors/autoMode' import { translate } from '../translation' import { locationTaskName } from '../utils/locationTaskName' +import { useApplicationFlagStore } from './useApplicationFlagStore' export const useStartBackgroundLocationUpdates = () => { - const autoModeEnabled = useRecoilValue(autoModeEnabledSelector) - useEffect(() => { + const autoModeEnabled = useApplicationFlagStore.getState()?.autoModeEnabled if (autoModeEnabled) { return } @@ -24,8 +21,7 @@ export const useStartBackgroundLocationUpdates = () => { }) return () => { - TaskManager.unregisterTaskAsync(locationTaskName) + Location.stopLocationUpdatesAsync(locationTaskName).catch(console.debug) } - // eslint-disable-next-line react-hooks/exhaustive-deps }, []) } diff --git a/src/index.tsx b/src/index.tsx index cb5c37bef..6d40ab2f7 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,7 +3,6 @@ import remoteConfig from '@react-native-firebase/remote-config' import { NavigationContainer } from '@react-navigation/native' import { createStackNavigator } from '@react-navigation/stack' import * as Location from 'expo-location' -import * as TaskManager from 'expo-task-manager' import React, { ErrorInfo, useCallback, useEffect, useState } from 'react' import { ErrorBoundary } from 'react-error-boundary' import { ActivityIndicator, StatusBar, StyleSheet, Text } from 'react-native' @@ -12,32 +11,11 @@ import ErrorFallback from './components/ErrorBoundary' import FakeStationSettings from './components/FakeStationSettings' import TuningSettings from './components/TuningSettings' import useAnonymousUser from './hooks/useAnonymousUser' -import { setLocation } from './hooks/useLocationStore' import useReport from './hooks/useReport' import PrivacyScreen from './screens/Privacy' import SavedRoutesScreen from './screens/SavedRoutesScreen' import MainStack from './stacks/MainStack' import { setI18nConfig } from './translation' -import { locationTaskName } from './utils/locationTaskName' - -TaskManager.defineTask( - locationTaskName, - ({ - data, - error, - }: { - data: { locations: Location.LocationObject[] } - error: TaskManager.TaskManagerError | null - }) => { - if (error) { - console.error(error) - return - } - - setLocation(data.locations[0]) - } -) -TaskManager.unregisterTaskAsync(locationTaskName) const Stack = createStackNavigator() diff --git a/src/screens/Main.tsx b/src/screens/Main.tsx index 2c7cc5606..96961841d 100644 --- a/src/screens/Main.tsx +++ b/src/screens/Main.tsx @@ -2,6 +2,8 @@ import AsyncStorage from '@react-native-async-storage/async-storage' import { useNavigation } from '@react-navigation/native' import { useKeepAwake } from 'expo-keep-awake' import * as Linking from 'expo-linking' +import { LocationObject } from 'expo-location' +import * as TaskManager from 'expo-task-manager' import React, { useCallback, useEffect, useMemo, useRef } from 'react' import { Alert, @@ -19,9 +21,11 @@ import Transfers from '../components/Transfers' import TransfersYamanote from '../components/TransfersYamanote' import TypeChangeNotify from '../components/TypeChangeNotify' import { ASYNC_STORAGE_KEYS } from '../constants' +import { useApplicationFlagStore } from '../hooks/useApplicationFlagStore' import useAutoMode from '../hooks/useAutoMode' import { useCurrentLine } from '../hooks/useCurrentLine' import { useCurrentStation } from '../hooks/useCurrentStation' +import { setLocation } from '../hooks/useLocationStore' import { useLoopLine } from '../hooks/useLoopLine' import { useNextStation } from '../hooks/useNextStation' import useRefreshLeftStations from '../hooks/useRefreshLeftStations' @@ -42,6 +46,25 @@ import { translate } from '../translation' import getCurrentStationIndex from '../utils/currentStationIndex' import { getIsHoliday } from '../utils/isHoliday' import getIsPass from '../utils/isPass' +import { locationTaskName } from '../utils/locationTaskName' + +TaskManager.defineTask( + locationTaskName, + ({ + data, + error, + }: { + data: { locations: LocationObject[] } + error: TaskManager.TaskManagerError | null + }) => { + if (error) { + console.error(error) + return + } + + setLocation(data.locations[0]) + } +) const { height: windowHeight } = Dimensions.get('window') @@ -56,11 +79,15 @@ const MainScreen: React.FC = () => { const isLEDTheme = theme === APP_THEME.LED const { stations, selectedDirection, arrived } = useRecoilValue(stationState) - const [{ leftStations, bottomState, autoModeEnabled }, setNavigation] = + const [{ leftStations, bottomState }, setNavigation] = useRecoilState(navigationState) const currentLine = useCurrentLine() const currentStation = useCurrentStation() + const autoModeEnabled = useApplicationFlagStore( + (state) => state.autoModeEnabled + ) + const nextStation = useNextStation() useAutoMode(autoModeEnabled) const { isYamanoteLine, isOsakaLoopLine, isMeijoLine } = useLoopLine() diff --git a/src/screens/SelectBound.tsx b/src/screens/SelectBound.tsx index 1ed984918..8cf1696fb 100644 --- a/src/screens/SelectBound.tsx +++ b/src/screens/SelectBound.tsx @@ -22,6 +22,7 @@ import Heading from '../components/Heading' import Typography from '../components/Typography' import { TOEI_OEDO_LINE_ID } from '../constants' import { TOEI_OEDO_LINE_TOCHOMAE_STATION_ID } from '../constants/station' +import { useApplicationFlagStore } from '../hooks/useApplicationFlagStore' import useBounds from '../hooks/useBounds' import { useLoopLine } from '../hooks/useLoopLine' import { useStationList } from '../hooks/useStationList' @@ -73,10 +74,8 @@ const SelectBoundScreen: React.FC = () => { const navigation = useNavigation() const [{ station, stations, wantedDestination }, setStationState] = useRecoilState(stationState) - const [ - { trainType, fetchedTrainTypes, autoModeEnabled, fromBuilder }, - setNavigationState, - ] = useRecoilState(navigationState) + const [{ trainType, fetchedTrainTypes, fromBuilder }, setNavigationState] = + useRecoilState(navigationState) const [{ selectedLine }, setLineState] = useRecoilState(lineState) const { loading, error, mutateStations } = useStationList() @@ -85,6 +84,13 @@ const SelectBoundScreen: React.FC = () => { bounds: [inboundStations, outboundStations], } = useBounds() + const autoModeEnabled = useApplicationFlagStore( + (state) => state.autoModeEnabled + ) + const toggleAutoModeEnabled = useApplicationFlagStore( + (state) => state.toggleAutoModeEnabled + ) + // 種別選択ボタンを表示するかのフラグ const withTrainTypes = useMemo( (): boolean => fetchedTrainTypes.length > 1, @@ -141,13 +147,6 @@ const SelectBoundScreen: React.FC = () => { navigation.navigate('TrainType') } - const handleAutoModeButtonPress = useCallback(async () => { - setNavigationState((prev) => ({ - ...prev, - autoModeEnabled: !prev.autoModeEnabled, - })) - }, [setNavigationState]) - const handleAllStopsButtonPress = useCallback(() => { const stopStations = stations.filter( (s) => s.stopCondition !== StopCondition.Not @@ -399,9 +398,7 @@ const SelectBoundScreen: React.FC = () => { {translate('selectBoundSettings')} ) : null} - + diff --git a/src/store/atoms/navigation.ts b/src/store/atoms/navigation.ts index 517c8152c..3b706195b 100644 --- a/src/store/atoms/navigation.ts +++ b/src/store/atoms/navigation.ts @@ -18,7 +18,6 @@ export interface NavigationState { // 実際の次の停車駅を保持している stationForHeader: Station | null enabledLanguages: AvailableLanguage[] - autoModeEnabled: boolean fetchedTrainTypes: TrainType[] fromBuilder: boolean } @@ -30,7 +29,6 @@ export const initialNavigationState: NavigationState = { leftStations: [], stationForHeader: null, enabledLanguages: ALL_AVAILABLE_LANGUAGES, - autoModeEnabled: false, fetchedTrainTypes: [], fromBuilder: false, } diff --git a/src/store/selectors/autoMode.ts b/src/store/selectors/autoMode.ts deleted file mode 100644 index 816c00792..000000000 --- a/src/store/selectors/autoMode.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { selector } from 'recoil' -import { RECOIL_STATES } from '../../constants' -import navigationState from '../atoms/navigation' - -export const autoModeEnabledSelector = selector({ - key: RECOIL_STATES.autoModeEnabledSelector, - get: ({ get }) => get(navigationState).autoModeEnabled, -})