diff options
Diffstat (limited to 'app/javascript/mastodon/features/account/containers/account_note_container.js')
-rw-r--r-- | app/javascript/mastodon/features/account/containers/account_note_container.js | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/app/javascript/mastodon/features/account/containers/account_note_container.js b/app/javascript/mastodon/features/account/containers/account_note_container.js index 92d470982..969af553a 100644 --- a/app/javascript/mastodon/features/account/containers/account_note_container.js +++ b/app/javascript/mastodon/features/account/containers/account_note_container.js @@ -1,34 +1,17 @@ import { connect } from 'react-redux'; -import { changeAccountNoteComment, submitAccountNote, initEditAccountNote, cancelAccountNote } from 'mastodon/actions/account_notes'; +import { submitAccountNote } from 'mastodon/actions/account_notes'; import AccountNote from '../components/account_note'; -const mapStateToProps = (state, { account }) => { - const isEditing = state.getIn(['account_notes', 'edit', 'account_id']) === account.get('id'); - - return { - isSubmitting: state.getIn(['account_notes', 'edit', 'isSubmitting']), - accountNote: isEditing ? state.getIn(['account_notes', 'edit', 'comment']) : account.getIn(['relationship', 'note']), - isEditing, - }; -}; +const mapStateToProps = (state, { account }) => ({ + value: account.getIn(['relationship', 'note']), +}); const mapDispatchToProps = (dispatch, { account }) => ({ - onEditAccountNote() { - dispatch(initEditAccountNote(account)); - }, - - onSaveAccountNote() { - dispatch(submitAccountNote()); + onSave (value) { + dispatch(submitAccountNote(account.get('id'), value)); }, - onCancelAccountNote() { - dispatch(cancelAccountNote()); - }, - - onChangeAccountNote(comment) { - dispatch(changeAccountNoteComment(comment)); - }, }); export default connect(mapStateToProps, mapDispatchToProps)(AccountNote); |