Reducers: TypeScript

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2022-06-24 00:33:23 +02:00
parent b9fc2c6e58
commit 4e545f0638
31 changed files with 130 additions and 136 deletions

View File

@ -37,7 +37,6 @@ const BirthdaysModal = ({ onClose }: IBirthdaysModal) => {
);
}
return (
<Modal
title={<FormattedMessage id='column.birthdays' defaultMessage='Birthdays' />}

View File

@ -43,7 +43,6 @@ const FamiliarFollowersModal = ({ accountId, onClose }: IFamiliarFollowersModal)
);
}
return (
<Modal
title={<FormattedMessage id='column.familiar_followers' defaultMessage='People you know following {name}' values={{ name: <span dangerouslySetInnerHTML={{ __html: account?.display_name_html || '' }} /> }} />}

View File

@ -30,7 +30,7 @@ const OtherActionsStep = ({ account }: IOtherActionsStep) => {
const features = useFeatures();
const intl = useIntl();
const statusIds = useAppSelector((state) => OrderedSet(state.timelines.getIn([`account:${account.id}:with_replies`, 'items'])).union(state.reports.new.status_ids) as OrderedSet<string>);
const statusIds = useAppSelector((state) => OrderedSet(state.timelines.get(`account:${account.id}:with_replies`)!.items).union(state.reports.new.status_ids) as OrderedSet<string>);
const isBlocked = useAppSelector((state) => state.reports.new.block);
const isForward = useAppSelector((state) => state.reports.new.forward);
const canForward = isRemote(account) && features.federating;

View File

@ -94,7 +94,6 @@ const ReactionsModal: React.FC<IReactionsModal> = ({ onClose, statusId, reaction
</>);
}
return (
<Modal
title={<FormattedMessage id='column.reactions' defaultMessage='Reactions' />}

View File

@ -50,7 +50,6 @@ const ReblogsModal: React.FC<IReblogsModal> = ({ onClose, statusId }) => {
);
}
return (
<Modal
title={<FormattedMessage id='column.reblogs' defaultMessage='Reposts' />}

View File

@ -27,12 +27,12 @@ const Timeline: React.FC<ITimeline> = ({
const dispatch = useAppDispatch();
const getStatusIds = useCallback(makeGetStatusIds, [])();
const lastStatusId = useAppSelector(state => state.timelines.getIn([timelineId, 'items'], ImmutableOrderedSet()).last() as string | undefined);
const lastStatusId = useAppSelector(state => (state.timelines.get(timelineId)?.items || ImmutableOrderedSet()).last() as string | undefined);
const statusIds = useAppSelector(state => getStatusIds(state, { type: timelineId }));
const isLoading = useAppSelector(state => state.timelines.getIn([timelineId, 'isLoading'], true) === true);
const isPartial = useAppSelector(state => state.timelines.getIn([timelineId, 'isPartial'], false) === true);
const hasMore = useAppSelector(state => state.timelines.getIn([timelineId, 'hasMore']) === true);
const totalQueuedItemsCount = useAppSelector(state => state.timelines.getIn([timelineId, 'totalQueuedItemsCount']));
const isLoading = useAppSelector(state => (state.timelines.get(timelineId) || { isLoading: true }).isLoading === true);
const isPartial = useAppSelector(state => (state.timelines.get(timelineId)?.isPartial || false) === true);
const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true);
const totalQueuedItemsCount = useAppSelector(state => state.timelines.get(timelineId)?.totalQueuedItemsCount || 0);
const handleDequeueTimeline = () => {
dispatch(dequeueTimeline(timelineId, onLoadMore));