diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-10-04 11:33:32 -0500 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-10-04 11:33:32 -0500 |
commit | 236c9080587ad9e63fa3330d2567640ea2f64fb4 (patch) | |
tree | a40bc4b31ab5594b8b07ebcf7b1e69c93842a6a5 /src/view/com/modals/ComposePost.tsx | |
parent | 0aaa406b179e366e6a527f052379184787440b42 (diff) | |
download | voidsky-236c9080587ad9e63fa3330d2567640ea2f64fb4.tar.zst |
Update the view after a post is created
Diffstat (limited to 'src/view/com/modals/ComposePost.tsx')
-rw-r--r-- | src/view/com/modals/ComposePost.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
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, |