Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mastofe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pleroma
mastofe
Commits
e12a5635
Unverified
Commit
e12a5635
authored
4 years ago
by
ThibG
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix not being able to vote (#13490)
Fix regression introduced by
ab8d7c06
parent
89077fb6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/javascript/mastodon/components/poll.js
+2
-3
2 additions, 3 deletions
app/javascript/mastodon/components/poll.js
app/javascript/mastodon/containers/poll_container.js
+5
-1
5 additions, 1 deletion
app/javascript/mastodon/containers/poll_container.js
with
7 additions
and
4 deletions
app/javascript/mastodon/components/poll.js
+
2
−
3
View file @
e12a5635
...
...
@@ -4,7 +4,6 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import
ImmutablePureComponent
from
'
react-immutable-pure-component
'
;
import
{
defineMessages
,
injectIntl
,
FormattedMessage
}
from
'
react-intl
'
;
import
classNames
from
'
classnames
'
;
import
{
vote
}
from
'
mastodon/actions/polls
'
;
import
Motion
from
'
mastodon/features/ui/util/optional_motion
'
;
import
spring
from
'
react-motion/lib/spring
'
;
import
escapeTextContentForBrowser
from
'
escape-html
'
;
...
...
@@ -28,9 +27,9 @@ class Poll extends ImmutablePureComponent {
static
propTypes
=
{
poll
:
ImmutablePropTypes
.
map
,
intl
:
PropTypes
.
object
.
isRequired
,
dispatch
:
PropTypes
.
func
,
disabled
:
PropTypes
.
bool
,
refresh
:
PropTypes
.
func
,
onVote
:
PropTypes
.
func
,
};
state
=
{
...
...
@@ -101,7 +100,7 @@ class Poll extends ImmutablePureComponent {
return
;
}
this
.
props
.
dispatch
(
vote
(
this
.
props
.
poll
.
get
(
'
id
'
),
Object
.
keys
(
this
.
state
.
selected
))
)
;
this
.
props
.
onVote
(
Object
.
keys
(
this
.
state
.
selected
));
};
handleRefresh
=
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
app/javascript/mastodon/containers/poll_container.js
+
5
−
1
View file @
e12a5635
...
...
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
import
{
debounce
}
from
'
lodash
'
;
import
Poll
from
'
mastodon/components/poll
'
;
import
{
fetchPoll
}
from
'
mastodon/actions/polls
'
;
import
{
fetchPoll
,
vote
}
from
'
mastodon/actions/polls
'
;
const
mapDispatchToProps
=
(
dispatch
,
{
pollId
})
=>
({
refresh
:
debounce
(
...
...
@@ -12,6 +12,10 @@ const mapDispatchToProps = (dispatch, { pollId }) => ({
1000
,
{
leading
:
true
},
),
onVote
(
choices
)
{
dispatch
(
vote
(
pollId
,
choices
));
},
});
const
mapStateToProps
=
(
state
,
{
pollId
})
=>
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment