fixing to settimeouts

This commit is contained in:
gustavo-em 2022-02-24 17:37:09 -03:00
parent 29394335af
commit 57f58f2c02
3 changed files with 4 additions and 6 deletions

View File

@ -102,6 +102,7 @@ export const ListPortals = ({ navigation }: IListPortalsDTO)=>{
closeOnRowPress={true}
closeOnRowOpen={true}
onRowOpen={(rowKey, rowMap) => {
//This timeout is recommended https://github.com/jemise111/react-native-swipe-list-view/blob/master/docs/migrating-to-flatlist.md
setTimeout(() => {
if(rowMap[rowKey] != undefined){
rowMap[rowKey].closeRow()

View File

@ -18,12 +18,9 @@ export const StorePortals = ({navigation, modalizeRef}:IStore)=>{
portalsStorage = await AsyncStorage.getItem('portal')
portalsStorage = portalsStorage ? JSON.parse(portalsStorage) : null
portalsStorage.push({name, url})
await AsyncStorage.setItem('portal', JSON.stringify(portalsStorage))
AsyncStorage.setItem('portal', JSON.stringify(portalsStorage))
setPortals(portalsStorage)
setTimeout(()=>{
modalizeRef?.current?.close();
}, 500)
navigation.navigate(name)
}