diff --git a/src/components/pages/view-comments.js b/src/components/pages/view-comments.js index a385d5f..9bccb75 100644 --- a/src/components/pages/view-comments.js +++ b/src/components/pages/view-comments.js @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { Dimensions, View, Image, TextInput, Text } from "react-native"; import { ScrollView } from "react-native-gesture-handler"; +import AsyncStorage from "@react-native-async-storage/async-storage"; import { timeToAge } from "src/interface/rendering"; import { activeOrNot } from "src/interface/interactions"; @@ -212,21 +213,22 @@ const ViewCommentsJsx = (props) => { }); useEffect(() => { - (() => { // Some magical function that will get all the data needed + AsyncStorage.getItem("@user_profile").then((profileJSON) => { setState({ ...state, descendants: threadify(TEST_CONTEXT.descendants), postData: props.navigation.getParam("postData"), + profile: JSON.parse(profileJSON), loaded: true, }); - })(); + }); }, []); return ( - - - - { state.loaded ? + { state.loaded ? + + + { state.descendants.map((thread, i) => { const comment = thread[0]; const subs = thread.slice(1); - return ( @@ -259,27 +260,27 @@ const ViewCommentsJsx = (props) => { } - : - } - - - - setState({...state, reply: c }) }/> - - - - + + + + setState({...state, reply: c }) }/> + + + + + - + : <> + } ); }