Stockage du choix de précision de géolocalisation
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import { Accuracy } from 'expo-location'
|
||||
import * as SecureStore from '@/utils/SecureStore'
|
||||
|
||||
export interface RunPayload {
|
||||
id: number
|
||||
@ -89,6 +90,7 @@ export const gameSlice = createSlice({
|
||||
},
|
||||
setLocationAccuracy: (state, action: PayloadAction<Accuracy | null>) => {
|
||||
state.settings.locationAccuracy = action.payload
|
||||
SecureStore.setItem('locationAccuracy', action.payload?.toString() ?? 'null')
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { Constants } from '@/constants/Constants'
|
||||
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
|
||||
import { LocationObject } from 'expo-location'
|
||||
import { Constants } from '@/constants/Constants'
|
||||
|
||||
|
||||
export type PlayerLocation = {
|
||||
id?: number
|
||||
|
@ -18,6 +18,7 @@ TaskManager.defineTask(LOCATION_TASK, async ({ data, error }: any) => {
|
||||
}
|
||||
const { locations } = data
|
||||
const lastLoc: Location.LocationObject = locations.at(-1)
|
||||
console.log("AAAAA", lastLoc)
|
||||
store.dispatch(setLastLocation(lastLoc))
|
||||
const playerId = store.getState().game.playerId
|
||||
if (socket.active && playerId) {
|
||||
|
Reference in New Issue
Block a user