From d8dec439a0ec92eadde72f077859e1e1918fae8d Mon Sep 17 00:00:00 2001 From: Mary Kate Fain Date: Sat, 8 Mar 2025 13:05:38 -0600 Subject: [PATCH] fix streak modal not appearing on compose form --- src/features/compose/components/compose-form.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/compose/components/compose-form.tsx b/src/features/compose/components/compose-form.tsx index c8dde1ef2..cac2faaac 100644 --- a/src/features/compose/components/compose-form.tsx +++ b/src/features/compose/components/compose-form.tsx @@ -29,6 +29,7 @@ import { useCompose } from 'soapbox/hooks/useCompose.ts'; import { useDraggedFiles } from 'soapbox/hooks/useDraggedFiles.ts'; import { useFeatures } from 'soapbox/hooks/useFeatures.ts'; import { useInstance } from 'soapbox/hooks/useInstance.ts'; +import { useOwnAccount } from 'soapbox/hooks/useOwnAccount.ts'; import { usePrevious } from 'soapbox/hooks/usePrevious.ts'; import QuotedStatusContainer from '../containers/quoted-status-container.tsx'; @@ -77,6 +78,9 @@ interface IComposeForm { } const ComposeForm = ({ id, shouldCondense, autoFocus, clickableAreaRef, event, group, extra, streak }: IComposeForm) => { + const { account } = useOwnAccount(); + const userStreak = streak ?? account?.ditto.streak.days; + const history = useHistory(); const intl = useIntl(); const dispatch = useAppDispatch(); @@ -158,7 +162,7 @@ const ComposeForm = ({ id, shouldCondense, autoFocus, clickab dispatch(changeCompose(id, text)); dispatch(submitCompose(id, { history })); - if (streak === 0 && features.streak) { + if (userStreak === 0 && features.streak) { dispatch(openModal('STREAK')); }