From 542d536dab627c9fd24ec0d440b0106d71153258 Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 16 Sep 2019 13:46:12 -0300 Subject: Scroll to top view change --- src/Board.js | 8 ++------ src/Home.js | 1 + src/Thread.js | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Board.js b/src/Board.js index e5997bc..31174e2 100644 --- a/src/Board.js +++ b/src/Board.js @@ -35,12 +35,8 @@ class Board extends Component { this.setState({ error: resource }); } this.setState({ isLoaded: true, threadList: resource["threads"] }); - }) - .catch(console.error); - } - - componentWillUnmount() { - console.log("will unmount"); + }); + window.scrollTo(0, 0); } componentDidUpdate(prevProps) { diff --git a/src/Home.js b/src/Home.js index 4544cf2..665a7a5 100644 --- a/src/Home.js +++ b/src/Home.js @@ -47,6 +47,7 @@ class Home extends Component { isLoaded: true }); }); + window.scrollTo(0, 0); } render() { diff --git a/src/Thread.js b/src/Thread.js index f23c081..3a964b5 100644 --- a/src/Thread.js +++ b/src/Thread.js @@ -50,6 +50,7 @@ class Thread extends Component { }); this.lastTime = resource.time; }); + window.scrollTo(0, 0); } componentWillUnmount() { -- cgit v1.2.1-18-gbd029