diff options
author | polwex <polwex@sortug.com> | 2025-09-18 03:48:14 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-09-18 03:48:14 +0700 |
commit | ad7ebd1756956724e0b167d88f924e707401a9aa (patch) | |
tree | 5f29ab38e41224245a93a2a00318b835278ac596 /front/src/components/post/Footer.tsx | |
parent | 4b016c908dda2019f3bf89e5a3d2eae535e5fbd2 (diff) |
fuck yeah
Diffstat (limited to 'front/src/components/post/Footer.tsx')
-rw-r--r-- | front/src/components/post/Footer.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/front/src/components/post/Footer.tsx b/front/src/components/post/Footer.tsx index 3e4bbdc..d16f4fc 100644 --- a/front/src/components/post/Footer.tsx +++ b/front/src/components/post/Footer.tsx @@ -13,15 +13,25 @@ function Footer({ poast, refetch }: PostProps) { const [_showMenu, setShowMenu] = useState(false); const [location, navigate] = useLocation(); const [reposting, _setReposting] = useState(false); - const { api, setComposerData, setModal } = useLocalState((s) => ({ + const { api, setComposerData, setModal, addNotification } = useLocalState((s) => ({ api: s.api, setComposerData: s.setComposerData, setModal: s.setModal, + addNotification: s.addNotification, })); const our = api!.airlock.our!; function doReply(e: React.MouseEvent) { e.stopPropagation(); setComposerData({ type: "reply", post: { trill: poast } }); + // Only add notification if replying to someone else's post + if (poast.author !== our) { + addNotification({ + type: "reply", + from: our, + message: `You replied to ${poast.author}'s post`, + postId: poast.id, + }); + } } function doQuote(e: React.MouseEvent) { e.stopPropagation(); |