aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-11-02 10:19:44 -0800
committerGitHub <noreply@github.com>2020-11-02 13:19:44 -0500
commitaacb9237466c42b2e26f52a6588e6307c137db6e (patch)
tree7086eaf2b96e1bc57121f4cc1230523102b3559e /src
parent24c269c9d52ec7cf2cd383a8d7c3aee43ed475c1 (diff)
[BUG FIX] -> 1 : Bottom of moments screen cut off 2 : Social media data double check [FRONTEND] (#84)
* BUG FIX -> 1 : Bottom of moments screen cut off 2 : Check for existence of accountData before displaying the same * small change * added more exception checking * FIX package error Co-authored-by: Ivan Chen <ivan@thetaggid.com>
Diffstat (limited to 'src')
-rw-r--r--src/components/profile/Content.tsx3
-rw-r--r--src/components/taggs/TaggPost.tsx2
-rw-r--r--src/components/taggs/TwitterTaggPost.tsx4
-rw-r--r--src/screens/profile/SocialMediaTaggs.tsx6
4 files changed, 7 insertions, 8 deletions
diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx
index 689fcaf7..a0af1e94 100644
--- a/src/components/profile/Content.tsx
+++ b/src/components/profile/Content.tsx
@@ -108,8 +108,7 @@ const Content: React.FC<ContentProps> = ({y, isProfileView}) => {
style={styles.container}
onScroll={(e) => y.setValue(e.nativeEvent.contentOffset.y)}
showsVerticalScrollIndicator={false}
- scrollEventThrottle={1}
- stickyHeaderIndices={[2, 4]}>
+ scrollEventThrottle={1}>
<ProfileCutout />
<ProfileHeader
isProfileView={isProfileView}
diff --git a/src/components/taggs/TaggPost.tsx b/src/components/taggs/TaggPost.tsx
index 071dbfc4..6ad9158b 100644
--- a/src/components/taggs/TaggPost.tsx
+++ b/src/components/taggs/TaggPost.tsx
@@ -14,7 +14,7 @@ const TaggPost: React.FC<TaggPostProps> = ({post}) => {
// Post with image and footer that shows caption
return (
<View style={styles.photoContainer}>
- {post.media_url.length === 1 && post.media_url[0] !== null ? (
+ {post.media_url?.length === 1 && post.media_url[0] !== null ? (
<Image
style={styles.imageWithMargin}
source={{uri: post.media_url[0]}}
diff --git a/src/components/taggs/TwitterTaggPost.tsx b/src/components/taggs/TwitterTaggPost.tsx
index d0d066c6..e2dca115 100644
--- a/src/components/taggs/TwitterTaggPost.tsx
+++ b/src/components/taggs/TwitterTaggPost.tsx
@@ -56,7 +56,7 @@ const TwitterTaggPost: React.FC<TwitterTaggPostProps> = ({
<React.Fragment />
)}
{/* Second part of content is an image or empty */}
- {post.media_url.length !== 0 ? (
+ {post.media_url?.length !== 0 ? (
<View style={styles.imageContainer}>
{post.media_url.length === 1 && post.media_url[0] !== null ? (
<Image style={styles.image} source={{uri: post.media_url[0]}} />
@@ -111,7 +111,7 @@ const TwitterTaggPost: React.FC<TwitterTaggPostProps> = ({
style={styles.replyShowThisThread}
onPress={() => {
if (post.in_reply_to?.permalink) {
- Linking.openURL(post.in_reply_to.permalink);
+ Linking.openURL(post.in_reply_to?.permalink || '');
}
}}>
Show this thread
diff --git a/src/screens/profile/SocialMediaTaggs.tsx b/src/screens/profile/SocialMediaTaggs.tsx
index 4b63b843..f43c30df 100644
--- a/src/screens/profile/SocialMediaTaggs.tsx
+++ b/src/screens/profile/SocialMediaTaggs.tsx
@@ -51,15 +51,15 @@ const SocialMediaTaggs: React.FC<SocialMediaTaggsProps> = ({route}) => {
<SocialMediaInfo
fullname={name}
type={socialMediaType}
- handle={accountData.handle}
+ handle={accountData?.handle}
/>
- {(accountData.posts as Array<
+ {(accountData?.posts as Array<
SimplePostType | TwitterPostType
>).map((post, index) =>
socialMediaType === 'Twitter' ? (
<TwitterTaggPost
key={index}
- ownerHandle={accountData.handle || '_'}
+ ownerHandle={accountData?.handle || '_'}
post={post as TwitterPostType}
/>
) : (