|
@@ -486,10 +486,10 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
setType(filterSettings.type);
|
|
|
setRegionsFilter({
|
|
|
visitedLabel:
|
|
|
- filterSettings.selectedVisible.value && filterSettings.selectedVisible.value === 1
|
|
|
+ filterSettings.selectedVisible?.value && filterSettings.selectedVisible.value === 1
|
|
|
? 'in'
|
|
|
: 'by',
|
|
|
- year: filterSettings.selectedYear.value ?? moment().year()
|
|
|
+ year: filterSettings.selectedYear?.value ?? moment().year()
|
|
|
});
|
|
|
setSeriesFilter(filterSettings.seriesFilter);
|
|
|
}
|
|
@@ -762,7 +762,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
}
|
|
|
)
|
|
|
: setUserData({ type: 'nm', id: +foundRegion });
|
|
|
- if (regionsList) {
|
|
|
+ if (regionsList && regionsList.data) {
|
|
|
const region = regionsList.data.find((region) => region.id === +foundRegion);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|
|
@@ -785,7 +785,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
}
|
|
|
)
|
|
|
: setUserData({ type: 'countries', id: +foundRegion });
|
|
|
- if (countriesList) {
|
|
|
+ if (countriesList && countriesList.data) {
|
|
|
const region = countriesList.data.find((region) => region.id === +foundRegion);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|
|
@@ -808,7 +808,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
}
|
|
|
)
|
|
|
: setUserData({ type: 'dare', id: +foundRegion });
|
|
|
- if (dareList) {
|
|
|
+ if (dareList && dareList.data) {
|
|
|
const region = dareList.data.find((region) => region.id === +foundRegion);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|
|
@@ -978,7 +978,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
)
|
|
|
: setUserData({ type: 'nm', id });
|
|
|
|
|
|
- if (regionsList) {
|
|
|
+ if (regionsList && regionsList.data) {
|
|
|
const region = regionsList.data.find((region) => region.id === +id);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|
|
@@ -1002,7 +1002,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
)
|
|
|
: setUserData({ type: 'countries', id });
|
|
|
|
|
|
- if (countriesList) {
|
|
|
+ if (countriesList && countriesList.data) {
|
|
|
const region = countriesList.data.find((region) => region.id === +id);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|
|
@@ -1026,7 +1026,7 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
)
|
|
|
: setUserData({ type: 'dare', id: +id });
|
|
|
|
|
|
- if (dareList) {
|
|
|
+ if (dareList && dareList.data) {
|
|
|
const region = dareList.data.find((region) => region.id === +id);
|
|
|
if (region) {
|
|
|
const bounds = turf.bbox(region.bbox);
|