mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 10:50:24 +00:00
Fixed the bug that the lock button is displayed only when the page is refreshed (#7102)
This commit is contained in:
@@ -117,7 +117,8 @@ class DirentListItem extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||||
if (nextProps.dirent && this.state.dirent && nextProps.dirent.name !== this.state.dirent.name) {
|
if (nextProps.dirent && this.state.dirent) {
|
||||||
|
if (nextProps.dirent.name !== this.state.dirent.name) {
|
||||||
this.setState({
|
this.setState({
|
||||||
dirent: nextProps.dirent,
|
dirent: nextProps.dirent,
|
||||||
}, () => {
|
}, () => {
|
||||||
@@ -132,6 +133,14 @@ class DirentListItem extends React.Component {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
nextProps.dirent.is_locked !== this.state.dirent.is_locked ||
|
||||||
|
nextProps.dirent.starred !== this.state.dirent.starred
|
||||||
|
) {
|
||||||
|
this.setState({ dirent: nextProps.dirent });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
|
Reference in New Issue
Block a user