aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-06-11 14:51:43 -0400
committerIvan Chen <ivan@tagg.id>2021-06-11 14:51:43 -0400
commit6ad0a54704523d7cb69b6789323ba26c4d53f63e (patch)
tree69313a7fd9bf7f4844d174281a46a980179752bc /src
parent2f9ecfb9bc89c7c6e7ac09952b97d3f3813075bc (diff)
Cleanup code
Diffstat (limited to 'src')
-rw-r--r--src/components/moments/MomentPost.tsx9
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 : []);
+ });
}, []);
/*