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,20 +117,29 @@ 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) {
|
||||||
this.setState({
|
if (nextProps.dirent.name !== this.state.dirent.name) {
|
||||||
dirent: nextProps.dirent,
|
this.setState({
|
||||||
}, () => {
|
dirent: nextProps.dirent,
|
||||||
if (this.checkGenerateThumbnail(nextProps.dirent)) {
|
}, () => {
|
||||||
const { repoID, path } = nextProps;
|
if (this.checkGenerateThumbnail(nextProps.dirent)) {
|
||||||
this.isGeneratingThumbnail = true;
|
const { repoID, path } = nextProps;
|
||||||
this.thumbnailCenter.createThumbnail({
|
this.isGeneratingThumbnail = true;
|
||||||
repoID,
|
this.thumbnailCenter.createThumbnail({
|
||||||
path: [path, nextProps.dirent.name].join('/'),
|
repoID,
|
||||||
callback: this.updateDirentThumbnail,
|
path: [path, nextProps.dirent.name].join('/'),
|
||||||
});
|
callback: this.updateDirentThumbnail,
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
nextProps.dirent.is_locked !== this.state.dirent.is_locked ||
|
||||||
|
nextProps.dirent.starred !== this.state.dirent.starred
|
||||||
|
) {
|
||||||
|
this.setState({ dirent: nextProps.dirent });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user