Merge pull request #5692 from SimonBrandner/scroll-to-bottom-setting

Add a scroll to bottom on message sent setting
This commit is contained in:
Travis Ralston 2021-03-02 17:41:15 -07:00 committed by GitHub
commit c7d4dfa4f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 1 deletions

View file

@ -404,7 +404,9 @@ export default class SendMessageComposer extends React.Component {
this._editorRef.clearUndoHistory();
this._editorRef.focus();
this._clearStoredEditorState();
dis.dispatch({action: "scroll_to_bottom"});
if (SettingsStore.getValue("scrollToBottomOnMessageSent")) {
dis.dispatch({action: "scroll_to_bottom"});
}
}
componentWillUnmount() {

View file

@ -48,6 +48,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
'showRedactions',
'enableSyntaxHighlightLanguageDetection',
'expandCodeByDefault',
'scrollToBottomOnMessageSent',
'showCodeLineNumbers',
'showJoinLeaves',
'showAvatarChanges',

View file

@ -809,6 +809,7 @@
"Enable automatic language detection for syntax highlighting": "Enable automatic language detection for syntax highlighting",
"Expand code blocks by default": "Expand code blocks by default",
"Show line numbers in code blocks": "Show line numbers in code blocks",
"Jump to the bottom of the timeline when you send a message": "Jump to the bottom of the timeline when you send a message",
"Show avatars in user and room mentions": "Show avatars in user and room mentions",
"Enable big emoji in chat": "Enable big emoji in chat",
"Send typing notifications": "Send typing notifications",

View file

@ -330,6 +330,11 @@ export const SETTINGS: {[setting: string]: ISetting} = {
displayName: _td('Show line numbers in code blocks'),
default: true,
},
"scrollToBottomOnMessageSent": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Jump to the bottom of the timeline when you send a message'),
default: true,
},
"Pill.shouldShowPillAvatar": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Show avatars in user and room mentions'),