|
@@ -420,7 +420,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
|
|
|
|
const [markerCoords, setMarkerCoords] = useState<any>(null);
|
|
const [markerCoords, setMarkerCoords] = useState<any>(null);
|
|
- const [interval, setInterval] = useState(0);
|
|
|
|
|
|
+ const [refreshInterval, setRefreshInterval] = useState(0);
|
|
|
|
|
|
const isSmallScreen = Dimensions.get('window').width < 383;
|
|
const isSmallScreen = Dimensions.get('window').width < 383;
|
|
const processedImages = useRef(new Set<string>());
|
|
const processedImages = useRef(new Set<string>());
|
|
@@ -703,16 +703,16 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
);
|
|
);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- if (interval > 0 && showNomads) {
|
|
|
|
|
|
+ if (refreshInterval > 0 && showNomads) {
|
|
const intervalId = setInterval(() => {
|
|
const intervalId = setInterval(() => {
|
|
if (location && token && showNomads) {
|
|
if (location && token && showNomads) {
|
|
refetchUsersLocation();
|
|
refetchUsersLocation();
|
|
}
|
|
}
|
|
- }, interval);
|
|
|
|
|
|
+ }, refreshInterval);
|
|
|
|
|
|
return () => clearInterval(intervalId);
|
|
return () => clearInterval(intervalId);
|
|
}
|
|
}
|
|
- }, [interval, showNomads]);
|
|
|
|
|
|
+ }, [refreshInterval, showNomads]);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
(async () => {
|
|
(async () => {
|
|
@@ -720,7 +720,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
const isServicesEnabled = await Location.hasServicesEnabledAsync();
|
|
const isServicesEnabled = await Location.hasServicesEnabledAsync();
|
|
|
|
|
|
if (locationSettings && locationSettings.sharing_refresh_interval) {
|
|
if (locationSettings && locationSettings.sharing_refresh_interval) {
|
|
- setInterval(locationSettings.sharing_refresh_interval * 1000);
|
|
|
|
|
|
+ setRefreshInterval(locationSettings.sharing_refresh_interval * 1000);
|
|
}
|
|
}
|
|
|
|
|
|
if (
|
|
if (
|