mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
cleanup
This commit is contained in:
parent
a366565d7c
commit
68631f27bf
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user