This commit is contained in:
srgooglo 2022-06-01 20:55:09 +02:00
parent a366565d7c
commit 68631f27bf

View File

@ -16,6 +16,7 @@ export default class PostsFeed extends React.Component {
} }
api = window.app.request api = window.app.request
listRef = React.createRef() listRef = React.createRef()
componentDidMount = async () => { componentDidMount = async () => {
@ -32,7 +33,7 @@ export default class PostsFeed extends React.Component {
registerWSEvents = async () => { registerWSEvents = async () => {
window.app.ws.listen(`post.new`, async (data) => { 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 }) this.setState({ animating: true })
} }
onInsert = async (data) => { insert = async (data) => {
const updatedList = this.state.list const updatedList = this.state.list
updatedList.unshift(data) updatedList.unshift(data)
@ -85,7 +86,10 @@ export default class PostsFeed extends React.Component {
} }
if (this.state.list.length === 0) { if (this.state.list.length === 0) {
return <antd.Empty /> return <div>
<antd.Empty />
<h1>Whoa, nothing on here...</h1>
</div>
} }
return <div return <div