Code Smell Fix
continuous-integration/drone/push Build is passing Details

pull/24/head^2
Louison PARANT 1 year ago
parent fed0694944
commit 4cbc138fb8

@ -25,16 +25,6 @@ export default function HomePage({ navigation, props }) {
const profileService = new ProfileService() const profileService = new ProfileService()
const handleGetProfiles = async () => {
try {
const existingProfiles = await AsyncStorage.getItem('profiles');
return JSON.parse(existingProfiles) || [];
} catch (error) {
console.log(error);
return [];
}
}
const handleGetAvailableIngredient = async () => { const handleGetAvailableIngredient = async () => {
try { try {
const existingAvailableIngredient = await AsyncStorage.getItem('ingredient'); const existingAvailableIngredient = await AsyncStorage.getItem('ingredient');

@ -6,7 +6,6 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
import ProfileService from '../Services/Profiles/ProfileService'; import ProfileService from '../Services/Profiles/ProfileService';
import ProfileDetails from '../components/ProfileDetails'; import ProfileDetails from '../components/ProfileDetails';
import ColorContext from '../theme/ColorContext'; import ColorContext from '../theme/ColorContext';
import AsyncStorage from '@react-native-async-storage/async-storage';
import eventEmitter from './EventEmitter'; import eventEmitter from './EventEmitter';
import { PaperProvider, Portal } from 'react-native-paper'; import { PaperProvider, Portal } from 'react-native-paper';
@ -29,10 +28,6 @@ export default function Profiles({navigation, props}) {
const handleDeleteProfile = async (index) => { const handleDeleteProfile = async (index) => {
try { try {
// const updatedProfiles = profiles.filter((profile, i) => i !== index);
// await AsyncStorage.setItem('profiles', JSON.stringify(updatedProfiles));
// eventEmitter.emit('profileDeleted');
profileService.delProfile(index) profileService.delProfile(index)
setSelectedProfileIndex(index); setSelectedProfileIndex(index);
erasePopUp(); erasePopUp();

Loading…
Cancel
Save