Increase scrollback fetch threshold slightly

This commit is contained in:
Ken-Håvard Lieng 2017-06-23 03:40:53 +02:00
parent 6c7bf0d81a
commit 7160db9614
2 changed files with 25 additions and 21 deletions

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,11 @@ import debounce from 'lodash/debounce';
import { getScrollPos, saveScrollPos } from 'util/scrollPosition'; import { getScrollPos, saveScrollPos } from 'util/scrollPosition';
import Message from './Message'; import Message from './Message';
const fetchThreshold = 500; const fetchThreshold = 600;
// The amount of time in ms that needs to pass without any
// scroll events happening before adding messages to the top,
// this is done to prevent the scroll from jumping all over the place
const scrollbackDebounce = 100;
export default class MessageBox extends PureComponent { export default class MessageBox extends PureComponent {
componentWillMount() { componentWillMount() {
@ -118,7 +122,7 @@ export default class MessageBox extends PureComponent {
const { tab, onAddMore } = this.props; const { tab, onAddMore } = this.props;
this.ready = true; this.ready = true;
onAddMore(tab.server, tab.name); onAddMore(tab.server, tab.name);
}, 100); }, scrollbackDebounce);
handleScroll = ({ scrollTop, clientHeight, scrollHeight }) => { handleScroll = ({ scrollTop, clientHeight, scrollHeight }) => {
if (this.mounted) { if (this.mounted) {