kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
fix streak modal not appearing on compose form
rodzic
4e74397ac0
commit
d8dec439a0
|
@ -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'));
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue