From 236c9080587ad9e63fa3330d2567640ea2f64fb4 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Tue, 4 Oct 2022 11:33:32 -0500
Subject: Update the view after a post is created

---
 src/view/com/modals/ComposePost.tsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'src/view/com/modals/ComposePost.tsx')

diff --git a/src/view/com/modals/ComposePost.tsx b/src/view/com/modals/ComposePost.tsx
index 510900b60..cecc478f7 100644
--- a/src/view/com/modals/ComposePost.tsx
+++ b/src/view/com/modals/ComposePost.tsx
@@ -16,7 +16,13 @@ const WARNING_TEXT_LENGTH = 200
 const DANGER_TEXT_LENGTH = 255
 export const snapPoints = ['100%']
 
-export function Component({replyTo}: {replyTo?: string}) {
+export function Component({
+  replyTo,
+  onPost,
+}: {
+  replyTo?: string
+  onPost?: () => void
+}) {
   const store = useStores()
   const [error, setError] = useState('')
   const [text, setText] = useState('')
@@ -72,6 +78,7 @@ export function Component({replyTo}: {replyTo?: string}) {
       )
       return
     }
+    onPost?.()
     store.shell.closeModal()
     Toast.show(`Your ${replyTo ? 'reply' : 'post'} has been published`, {
       duration: Toast.durations.LONG,
-- 
cgit 1.4.1

