From 6ad0a54704523d7cb69b6789323ba26c4d53f63e Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Fri, 11 Jun 2021 14:51:43 -0400 Subject: Cleanup code --- src/components/moments/MomentPost.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index 7a588325..3b2721a0 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -34,16 +34,13 @@ const MomentPost: React.FC = ({ const isOwnProfile = username === loggedInUsername; - const loadTags = async () => { - const response = await loadMomentTags(moment.moment_id); - setTags(response ? response : []); - }; - /* * Load tags on initial render to pass tags data to moment header and content */ useEffect(() => { - loadTags(); + loadMomentTags(moment.moment_id).then((response) => { + setTags(response ? response : []); + }); }, []); /* -- cgit v1.2.3-70-g09d2