From 6392f972f51e06a239d11caa71a5ba1714ef9632 Mon Sep 17 00:00:00 2001 From: Renard Date: Tue, 17 Sep 2019 16:35:32 -0300 Subject: Fix autoupdate home --- src/Home.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Home.js b/src/Home.js index 74c91f6..2bc3fa0 100644 --- a/src/Home.js +++ b/src/Home.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { List, Header, Label, Icon, Loader, Grid } from "semantic-ui-react"; +import { List, Header, Icon, Loader, Grid } from "semantic-ui-react"; import Moment from "react-moment"; import "moment/locale/es"; @@ -27,12 +27,12 @@ class Home extends Component { return response.json(); }) .then(resource => { + this.lastTime = resource.time; + this.lastTimeNoAge = resource.time; this.setState({ lastAgeThreads: resource["threads"], autoRefresh: setInterval(() => this.updateAges(), 1000) }); - this.lastTime = resource.time; - this.lastTimeNoAge = resource.time; }); fetch("https://bienvenidoainternet.org/cgi/api/newThreads?limit=10") @@ -105,7 +105,6 @@ class Home extends Component { const { newThreadsList, lastAgeThreads, latestNews } = this.state; document.title = "B.a.I Home"; - return ( @@ -115,7 +114,11 @@ class Home extends Component { {lastAgeThreads.map(thread => ( this.lastTimeNoAge + ? "bullhorn" + : "comment alternate outline" + } size="large" verticalAlign="middle" /> @@ -125,9 +128,6 @@ class Home extends Component { to={`${thread.dir}/read/${thread.id}`} > {thread.content} - {thread.bumped > this.lastTimeNoAge ? ( - - ) : null} {thread.board_fulln} ―{" "} -- cgit v1.2.1-18-gbd029