techmatters / terraso-mobile-client

A React Native project for Terraso’s LandPKS mobile application.
https://landpks.terraso.org
GNU Affero General Public License v3.0
2 stars 1 forks source link

Refactor: make screens take IDs instead of data #2463

Closed knipec closed 2 weeks ago

knipec commented 2 weeks ago

Description

A few screens were taking data like User or Project. This means that if you were viewing the screen, a pull happened that deleted the data, the screen might not update and might cause errors. Make them take userId or projectId, and retrieve the corresponding data from redux.

AddUserToProjectRoleScreen: took a User who maybe at that point had not been added to the cached set of users in redux's accountSlice. So this change will add a user to the users set after the prior screen first retrieves their info from the backend -- an intermediate part of the "Add user to project" flow -- instead of at the end of the flow.

Related Issues

Addresses #2289