Convert polls to Typescript / Immutable Records (#29789)

This commit is contained in:
Renaud Chaput 2024-12-10 23:54:07 +01:00 committed by GitHub
parent e4e35ab134
commit ded799f913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 272 additions and 186 deletions

View file

@ -9,14 +9,14 @@ import Poll from 'mastodon/components/poll';
const mapDispatchToProps = (dispatch, { pollId }) => ({
refresh: debounce(
() => {
dispatch(fetchPoll(pollId));
dispatch(fetchPoll({ pollId }));
},
1000,
{ leading: true },
),
onVote (choices) {
dispatch(vote(pollId, choices));
dispatch(vote({ pollId, choices }));
},
onInteractionModal (type, status) {
@ -32,7 +32,7 @@ const mapDispatchToProps = (dispatch, { pollId }) => ({
});
const mapStateToProps = (state, { pollId }) => ({
poll: state.getIn(['polls', pollId]),
poll: state.polls.get(pollId),
});
export default connect(mapStateToProps, mapDispatchToProps)(Poll);