Remember scroll position when navigating back, do not needlessly reload

entire timelines (only fetch since last known ID). Side effect: account
timelines no longer update in real-time
This commit is contained in:
Eugen Rochko
2016-10-18 23:06:28 +02:00
parent 1d2175f73c
commit 8698cd3281
10 changed files with 76 additions and 20 deletions

View File

@ -10,11 +10,13 @@ import { setAccessToken } from '../actions/meta';
import { setAccountSelf } from '../actions/accounts';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import {
applyRouterMiddleware,
Router,
Route,
hashHistory,
IndexRoute
} from 'react-router';
import { useScroll } from 'react-router-scroll';
import UI from '../features/ui';
import Account from '../features/account';
import Status from '../features/status';
@ -71,7 +73,7 @@ const Mastodon = React.createClass({
render () {
return (
<Provider store={store}>
<Router history={hashHistory}>
<Router history={hashHistory} render={applyRouterMiddleware(useScroll())}>
<Route path='/' component={UI}>
<IndexRoute component={GettingStarted} />
<Route path='/statuses/new' component={Compose} />