added docker stuff and updated next.js to ^7.0.0
This commit is contained in:
@@ -40,11 +40,10 @@ class Index extends Component {
|
||||
static getDerivedStateFromProps(nextProps, prevState) {
|
||||
let { docs, total, page, $search } = nextProps
|
||||
if (
|
||||
docs.length !== prevState.docs.length ||
|
||||
page !== prevState.page ||
|
||||
$search !== prevState.$search
|
||||
!prevState.didInit &&
|
||||
(page !== prevState.page || $search !== prevState.$search)
|
||||
) {
|
||||
return { total, docs, page, $search, pending: false }
|
||||
return { total, docs, page, $search, pending: false, didInit: true }
|
||||
}
|
||||
return null
|
||||
}
|
||||
@@ -92,6 +91,10 @@ class Index extends Component {
|
||||
this.updDocs(1)
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.updDocs(1)
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
const { user, docs } = this.props
|
||||
if (prevProps.user.email === user.email) return
|
||||
@@ -152,7 +155,9 @@ class Index extends Component {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{docs.map(doc => <DocItem {...doc} key={doc.id} />)}
|
||||
{docs.map(doc => (
|
||||
<DocItem {...doc} key={doc.id} />
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
{pages < 2 ? null : (
|
||||
|
||||
Reference in New Issue
Block a user