Enable profile.js to retrieve profile data from AsyncStorage
This commit is contained in:
parent
42a9036547
commit
d344ad8933
|
@ -8,6 +8,7 @@ import {
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
import * as Linking from "expo-linking";
|
import * as Linking from "expo-linking";
|
||||||
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
||||||
|
|
||||||
import { activeOrNot } from "src/interface/interactions";
|
import { activeOrNot } from "src/interface/interactions";
|
||||||
import { withoutHTML } from "src/interface/rendering";
|
import { withoutHTML } from "src/interface/rendering";
|
||||||
|
@ -149,13 +150,14 @@ const ProfileDisplayJsx = ({navigation}) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// do something to get the profile based on given account name
|
AsyncStorage.getItem("@user_profile").then((profileJSON) => {
|
||||||
setState({
|
setState({
|
||||||
profile: TEST_PROFILE,
|
profile: JSON.parse(profileJSON),
|
||||||
mutuals: getMutuals(TEST_YOUR_FOLLOWERS, TEST_THEIR_FOLLOWERS),
|
mutuals: getMutuals(TEST_YOUR_FOLLOWERS, TEST_THEIR_FOLLOWERS),
|
||||||
own: true,
|
own: true,
|
||||||
loaded: true,
|
loaded: true,
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
let profileButton;
|
let profileButton;
|
||||||
|
|
Loading…
Reference in New Issue