|
|
|
@ -15,9 +15,6 @@ export default function Profiles({navigation, props}) {
|
|
|
|
|
const colors = useContext(ColorContext).colors
|
|
|
|
|
const profile_service = new ProfileService()
|
|
|
|
|
|
|
|
|
|
const all = []
|
|
|
|
|
const die = [{value: "Dairy free"}, {value: "Gluten free"}, {value: "Porkless"}, {value: "Vegan"}, {value: "Vegetarian"}, {value: "Pescatarian"}]
|
|
|
|
|
|
|
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
|
const [profiles, setProfiles] = useState([]);
|
|
|
|
|
const [selectedProfileIndex, setSelectedProfileIndex] = useState(null);
|
|
|
|
@ -45,10 +42,10 @@ export default function Profiles({navigation, props}) {
|
|
|
|
|
|
|
|
|
|
const handleGetProfiles = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const results = await profile_service.getProfiles()
|
|
|
|
|
return results
|
|
|
|
|
const existingProfiles = await AsyncStorage.getItem('profiles');
|
|
|
|
|
return JSON.parse(existingProfiles) || [];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(error);
|
|
|
|
|
console.log("Error occured during GetProfiles", error);
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -227,8 +224,6 @@ export default function Profiles({navigation, props}) {
|
|
|
|
|
</View>
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<SafeAreaProvider style={{flex: 1}}>
|
|
|
|
|
<PaperProvider>
|
|
|
|
|