From 55901c33e5f6f1c023c1883af8629fa61cb4b8e6 Mon Sep 17 00:00:00 2001
From: natjms
Date: Tue, 29 Mar 2022 20:50:24 -0700
Subject: [PATCH] Prevent rendering notes on profiles when they aren't present
---
src/components/pages/profile.js | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/components/pages/profile.js b/src/components/pages/profile.js
index 919035f..ce83594 100644
--- a/src/components/pages/profile.js
+++ b/src/components/pages/profile.js
@@ -250,6 +250,21 @@ const ProfileJsx = ({ navigation }) => {
const RawProfileJsx = (props) => {
let profileButton;
+
+ /* Some profiles won't have a note, and react-native-render-html will
+ * issue a warning if it isn't passed any content. So, if there's no
+ * note with the account (or if it's an empty string, possibly), the
+ * element shouldn't be rendered at all.
+ */
+ let noteIfPresent = <>>;
+ if (props.profile.note != null && props.profile.note.length != "") {
+ noteIfPresent = (
+
+ );
+ }
+
if (props.own) {
profileButton = (
{
-
+ { noteIfPresent }
{ props.profile.fields
? props.profile.fields.map((field, index) => (