From 68631f27bfc3fd040d9882321663f2017156592b Mon Sep 17 00:00:00 2001 From: srgooglo Date: Wed, 1 Jun 2022 20:55:09 +0200 Subject: [PATCH] cleanup --- packages/app/src/components/PostsFeed/index.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/PostsFeed/index.jsx b/packages/app/src/components/PostsFeed/index.jsx index 8af76542..0d5dce80 100644 --- a/packages/app/src/components/PostsFeed/index.jsx +++ b/packages/app/src/components/PostsFeed/index.jsx @@ -16,6 +16,7 @@ export default class PostsFeed extends React.Component { } api = window.app.request + listRef = React.createRef() componentDidMount = async () => { @@ -32,7 +33,7 @@ export default class PostsFeed extends React.Component { registerWSEvents = async () => { window.app.ws.listen(`post.new`, async (data) => { - this.onInsert(data) + this.insert(data) }) } @@ -63,7 +64,7 @@ export default class PostsFeed extends React.Component { this.setState({ animating: true }) } - onInsert = async (data) => { + insert = async (data) => { const updatedList = this.state.list updatedList.unshift(data) @@ -85,7 +86,10 @@ export default class PostsFeed extends React.Component { } if (this.state.list.length === 0) { - return + return
+ +

Whoa, nothing on here...

+
} return