fix streak modal not appearing on compose form

merge-requests/3348/head
Mary Kate Fain 2025-03-08 13:05:38 -06:00
rodzic 4e74397ac0
commit d8dec439a0
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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<ID extends string> {
}
const ComposeForm = <ID extends string>({ id, shouldCondense, autoFocus, clickableAreaRef, event, group, extra, streak }: IComposeForm<ID>) => {
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 extends string>({ 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'));
}