|
|
@@ -1,5 +1,5 @@
|
|
|
import React, { useEffect, useState, useRef } from 'react';
|
|
|
-import { View, Text, TouchableOpacity, ScrollView } from 'react-native';
|
|
|
+import { View, Text, TouchableOpacity, ScrollView, Alert } from 'react-native';
|
|
|
import ReactModal from 'react-native-modal';
|
|
|
import { useNavigation } from '@react-navigation/native';
|
|
|
import { Picker as WheelPicker } from 'react-native-wheel-pick';
|
|
|
@@ -364,6 +364,12 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
|
|
|
};
|
|
|
});
|
|
|
|
|
|
+ if (regionsData.length >= 30) {
|
|
|
+ Alert.alert('One trip cannot have more than 30 regions.');
|
|
|
+ setIsLoading(null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
saveNewTrip(
|
|
|
{
|
|
|
token,
|
|
|
@@ -406,6 +412,12 @@ const AddNewTripScreen = ({ route }: { route: any }) => {
|
|
|
};
|
|
|
});
|
|
|
|
|
|
+ if (regionsData.length >= 30) {
|
|
|
+ Alert.alert('One trip cannot have more than 30 regions.');
|
|
|
+ setIsLoading(null);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
updateTrip(
|
|
|
{
|
|
|
token,
|