Enable profile.js to retrieve profile data from AsyncStorage

This commit is contained in:
Nat 2021-03-31 15:23:33 -03:00
parent 42a9036547
commit d344ad8933
1 changed files with 8 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import {
} from "react-native";
import * as Linking from "expo-linking";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { activeOrNot } from "src/interface/interactions";
import { withoutHTML } from "src/interface/rendering";
@ -149,12 +150,13 @@ const ProfileDisplayJsx = ({navigation}) => {
}
useEffect(() => {
// do something to get the profile based on given account name
setState({
profile: TEST_PROFILE,
mutuals: getMutuals(TEST_YOUR_FOLLOWERS, TEST_THEIR_FOLLOWERS),
own: true,
loaded: true,
AsyncStorage.getItem("@user_profile").then((profileJSON) => {
setState({
profile: JSON.parse(profileJSON),
mutuals: getMutuals(TEST_YOUR_FOLLOWERS, TEST_THEIR_FOLLOWERS),
own: true,
loaded: true,
});
});
}, []);