Maintain scroll positions when switching tabs

This commit is contained in:
Ken-Håvard Lieng 2017-05-03 22:56:06 +02:00
parent 45c61e7596
commit 52acec9d21
4 changed files with 81 additions and 29 deletions

View file

@ -28,7 +28,7 @@ function updateSelected({ params, dispatch }) {
}
function updateCharWidth() {
const charWidth = stringWidth(' ', '16px Roboto Mono');
const charWidth = stringWidth(' ', '16px Roboto Mono, monospace');
window.messageIndent = 6 * charWidth;
return setCharWidth(charWidth);
}
@ -38,9 +38,6 @@ class Chat extends PureComponent {
const { dispatch } = this.props;
dispatch(updateCharWidth());
setTimeout(() => dispatch(updateCharWidth()), 1000);
}
componentDidMount() {
updateSelected(this.props);
}