about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2024-06-10 13:02:00 -0700
committerGitHub <noreply@github.com>2024-06-10 22:02:00 +0200
commitc2d7d23423fbd0064c192dd3998bfc692aa6248c (patch)
treea5ead7b8366bb2b96e7a843fb2f0ad878e3a3907
parent0404111f031bdea33665c4e1df87da5e50a2ed5a (diff)
downloadvoidsky-c2d7d23423fbd0064c192dd3998bfc692aa6248c.tar.zst
Give a meaningful error in the composer when replying to a deleted post (#4464)
-rw-r--r--src/view/com/composer/Composer.tsx13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index fac08a711..5bcac2e67 100644
--- a/src/view/com/composer/Composer.tsx
+++ b/src/view/com/composer/Composer.tsx
@@ -305,7 +305,13 @@ export const ComposePost = observer(function ComposePost({
           localThumb: undefined,
         } as apilib.ExternalEmbedDraft)
       }
-      setError(cleanError(e.message))
+      let err = cleanError(e.message)
+      if (err.includes('not locate record')) {
+        err = _(
+          msg`We're sorry! The post you are replying to has been deleted.`,
+        )
+      }
+      setError(err)
       setIsProcessing(false)
       return
     } finally {
@@ -785,11 +791,12 @@ const styles = StyleSheet.create({
   },
   errorLine: {
     flexDirection: 'row',
+    alignItems: 'center',
     backgroundColor: colors.red1,
     borderRadius: 6,
     marginHorizontal: 16,
-    paddingHorizontal: 8,
-    paddingVertical: 6,
+    paddingHorizontal: 12,
+    paddingVertical: 10,
     marginBottom: 8,
   },
   reminderLine: {