diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-09-28 20:58:03 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-09-28 21:01:09 +0200 |
commit | 86b2b009ddb8486591fd6e2f986d7f46880fd308 (patch) | |
tree | 573464c52eeb303aba68339199fbdff6378e0a16 /app/javascript/flavours/glitch/features | |
parent | 15134beb1e45be35a5c0091220c9074b79f64653 (diff) |
Make pre-selection of usernames optional when replying to a toot
Fixes #751
Diffstat (limited to 'app/javascript/flavours/glitch/features')
-rw-r--r-- | app/javascript/flavours/glitch/features/composer/index.js | 5 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/features/local_settings/page/index.js | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index ff01408e7..1280af75e 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; @@ -533,6 +535,7 @@ Composer.propTypes = { anyMedia: PropTypes.bool, spoilersAlwaysOn: PropTypes.bool, mediaDescriptionConfirmation: PropTypes.bool, + preselectOnReply: PropTypes.bool, // Dispatch props. onCancelReply: PropTypes.func, diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js index 3859c1947..5b4e0cb01 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js @@ -108,6 +108,14 @@ export default class LocalSettingsPage extends React.PureComponent { </LocalSettingsPageItem> <LocalSettingsPageItem settings={settings} + item={['preselect_on_reply']} + id='mastodon-settings--preselect_on_reply' + onChange={onChange} + > + <FormattedMessage id='settings.preselect_on_reply' defaultMessage='Pre-select usernames past the first when replying to a toot with multiple participants' /> + </LocalSettingsPageItem> + <LocalSettingsPageItem + settings={settings} item={['confirm_missing_media_description']} id='mastodon-settings--confirm_missing_media_description' onChange={onChange} |