diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-11 14:51:43 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-11 14:51:43 -0400 |
commit | 6ad0a54704523d7cb69b6789323ba26c4d53f63e (patch) | |
tree | 69313a7fd9bf7f4844d174281a46a980179752bc /src | |
parent | 2f9ecfb9bc89c7c6e7ac09952b97d3f3813075bc (diff) |
Cleanup code
Diffstat (limited to 'src')
-rw-r--r-- | src/components/moments/MomentPost.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
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<MomentPostProps> = ({ 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 : []); + }); }, []); /* |