aboutsummaryrefslogtreecommitdiff
path: root/src/Board.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-17 01:52:07 -0300
committerLibravatar Renard 2019-09-17 01:52:07 -0300
commit7266c58d7161fe8adc80bb434c81599bb8d7248c (patch)
tree5f9eb77e9abba9d02489d2785866fbd2d192ae1f /src/Board.js
parent07f8514ee09dbe4154166e3f8c4189e2953293df (diff)
downloadbai-client-7266c58d7161fe8adc80bb434c81599bb8d7248c.tar.gz
bai-client-7266c58d7161fe8adc80bb434c81599bb8d7248c.tar.xz
bai-client-7266c58d7161fe8adc80bb434c81599bb8d7248c.zip
Fix: keys y offset
Diffstat (limited to 'src/Board.js')
-rw-r--r--src/Board.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Board.js b/src/Board.js
index 55df603..e4ec05a 100644
--- a/src/Board.js
+++ b/src/Board.js
@@ -56,8 +56,9 @@ class Board extends Component {
}
fetchMoreThreads() {
+ console.log("fetching more");
fetch(
- `https://bienvenidoainternet.org/cgi/api/list?dir=${this.props.dir}&replies=5&limit=10&offset${this.threadOffset}`
+ `https://bienvenidoainternet.org/cgi/api/list?dir=${this.props.dir}&replies=5&limit=10&offset=${this.threadOffset}`
)
.then(response => {
return response.json();
@@ -66,6 +67,7 @@ class Board extends Component {
if (resource.state === "success") {
if (resource.threads.length > 0) {
const moreThreads = this.state.threadList.concat(resource.threads);
+ this.threadOffset += 10;
this.setState({ threadList: moreThreads, loadingMore: false });
}
}
@@ -122,7 +124,7 @@ class Board extends Component {
<Breadcrumb.Section link>{currentBoard.name}</Breadcrumb.Section>
</Breadcrumb>
{threadList.map(thread => (
- <Segment.Group key={thread.id}>
+ <Segment.Group key={"seg_" + thread.timestamp + thread.id}>
<Header as="h3" attached>
<Link to={`/${this.props.dir}/read/${thread.id}`}>
{thread.subject}
@@ -147,7 +149,7 @@ class Board extends Component {
post={reply}
locked={thread.locked}
threadId={thread.id}
- key={index}
+ key={"reply_" + reply.id}
currentBoard={currentBoard}
/>
))}