|
@@ -303,6 +303,8 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
const { data: countriesList } = useGetListCountriesQuery(isConnected);
|
|
const { data: countriesList } = useGetListCountriesQuery(isConnected);
|
|
const { data: dareList } = useGetListDareQuery(isConnected);
|
|
const { data: dareList } = useGetListDareQuery(isConnected);
|
|
|
|
|
|
|
|
+ const [usersCount, setUsersCount] = useState(0);
|
|
|
|
+
|
|
const [tilesType, setTilesType] = useState({ label: 'NM regions', value: 0 });
|
|
const [tilesType, setTilesType] = useState({ label: 'NM regions', value: 0 });
|
|
const tilesTypes = [
|
|
const tilesTypes = [
|
|
{ label: 'Blank', value: -1 },
|
|
{ label: 'Blank', value: -1 },
|
|
@@ -463,9 +465,23 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
if (!nomads || JSON.stringify(filteredNomads) !== JSON.stringify(nomads)) {
|
|
if (!nomads || JSON.stringify(filteredNomads) !== JSON.stringify(nomads)) {
|
|
setNomads(filteredNomads);
|
|
setNomads(filteredNomads);
|
|
}
|
|
}
|
|
|
|
+ if (usersOnMapCount && usersOnMapCount.count) {
|
|
|
|
+ setUsersCount(usersOnMapCount.count);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, [usersLocation, showNomads, refreshInterval]);
|
|
}, [usersLocation, showNomads, refreshInterval]);
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (
|
|
|
|
+ usersOnMapCount &&
|
|
|
|
+ usersOnMapCount.count &&
|
|
|
|
+ !nomadsFilter.friends &&
|
|
|
|
+ !nomadsFilter.countries?.length
|
|
|
|
+ ) {
|
|
|
|
+ setUsersCount(usersOnMapCount.count);
|
|
|
|
+ }
|
|
|
|
+ }, [usersOnMapCount]);
|
|
|
|
+
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
const loadCachedIcons = async () => {
|
|
const loadCachedIcons = async () => {
|
|
try {
|
|
try {
|
|
@@ -677,6 +693,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
{
|
|
{
|
|
onSuccess: (data) => {
|
|
onSuccess: (data) => {
|
|
if (data && data?.geojson) {
|
|
if (data && data?.geojson) {
|
|
|
|
+ setUsersCount(data.geojson.features?.length);
|
|
const filteredNomads: GeoJSON.FeatureCollection = {
|
|
const filteredNomads: GeoJSON.FeatureCollection = {
|
|
type: 'FeatureCollection',
|
|
type: 'FeatureCollection',
|
|
features: data.geojson.features.filter(
|
|
features: data.geojson.features.filter(
|
|
@@ -1989,9 +2006,9 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
text="Nomads"
|
|
text="Nomads"
|
|
active={showNomads || nomadsFilter.friends || nomadsFilter.countries?.length}
|
|
active={showNomads || nomadsFilter.friends || nomadsFilter.countries?.length}
|
|
>
|
|
>
|
|
- {usersOnMapCount && usersOnMapCount?.count > 0 ? (
|
|
|
|
|
|
+ {usersCount && usersCount > 0 ? (
|
|
<MessagesDot
|
|
<MessagesDot
|
|
- messagesCount={usersOnMapCount.count}
|
|
|
|
|
|
+ messagesCount={usersCount}
|
|
fullNumber={true}
|
|
fullNumber={true}
|
|
right={-10}
|
|
right={-10}
|
|
top={-8}
|
|
top={-8}
|