diff options
author | Renard | 2019-09-17 16:35:32 -0300 |
---|---|---|
committer | Renard | 2019-09-17 16:35:32 -0300 |
commit | 6392f972f51e06a239d11caa71a5ba1714ef9632 (patch) | |
tree | a27451ad43ec9f21e43db34c164e84921da233f3 /src | |
parent | efc593ead7fc650f197ee630c09a176921dfc6ab (diff) | |
download | bai-client-6392f972f51e06a239d11caa71a5ba1714ef9632.tar.gz bai-client-6392f972f51e06a239d11caa71a5ba1714ef9632.tar.xz bai-client-6392f972f51e06a239d11caa71a5ba1714ef9632.zip |
Fix autoupdate home
Diffstat (limited to 'src')
-rw-r--r-- | src/Home.js | 16 |
1 files changed, 8 insertions, 8 deletions
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 ( <Grid columns={2} divided container doubling> <Grid.Row> @@ -115,7 +114,11 @@ class Home extends Component { {lastAgeThreads.map(thread => ( <List.Item key={thread.id}> <List.Icon - name="comment alternate outline" + name={ + thread.bumped > 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 ? ( - <Icon name="star" color="red" size="small" /> - ) : null} </List.Header> <List.Description as="a"> <Icon name="folder open outline" /> {thread.board_fulln} ―{" "} |