diff options
author | David Yip <yipdw@member.fsf.org> | 2018-09-29 19:01:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-29 19:01:05 -0500 |
commit | 2bb3c8c9446dd8cd47e0e0b4d9e899b8a5a546f2 (patch) | |
tree | aa022fe71ee84df26cbf58cd13d466955cd1665b /app/javascript/flavours/glitch/features/composer | |
parent | 19968912fae52917bdbbd73cdfc5d03a82a0d554 (diff) | |
parent | 86b2b009ddb8486591fd6e2f986d7f46880fd308 (diff) |
Merge pull request #755 from ThibG/glitch-soc/features/optional-reply-selection
Make pre-selection of usernames optional when replying to a toot
Diffstat (limited to 'app/javascript/flavours/glitch/features/composer')
-rw-r--r-- | app/javascript/flavours/glitch/features/composer/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index 522f9d798..257797047 100644 --- a/app/javascript/flavours/glitch/features/composer/index.js +++ b/app/javascript/flavours/glitch/features/composer/index.js @@ -102,6 +102,7 @@ function mapStateToProps (state) { anyMedia: state.getIn(['compose', 'media_attachments']).size > 0, spoilersAlwaysOn: spoilersAlwaysOn, mediaDescriptionConfirmation: state.getIn(['local_settings', 'confirm_missing_media_description']), + preselectOnReply: state.getIn(['local_settings', 'preselect_on_reply']), }; }; @@ -328,13 +329,14 @@ class Composer extends React.Component { isSubmitting, preselectDate, text, + preselectOnReply, } = this.props; let selectionEnd, selectionStart; // Caret/selection handling. if (focusDate !== prevProps.focusDate) { switch (true) { - case preselectDate !== prevProps.preselectDate: + case preselectDate !== prevProps.preselectDate && preselectOnReply: selectionStart = text.search(/\s/) + 1; selectionEnd = text.length; break; @@ -534,6 +536,7 @@ Composer.propTypes = { anyMedia: PropTypes.bool, spoilersAlwaysOn: PropTypes.bool, mediaDescriptionConfirmation: PropTypes.bool, + preselectOnReply: PropTypes.bool, // Dispatch props. onCancelReply: PropTypes.func, |