1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

remove redundant path reset, remove unsafe lifecycle method

This commit is contained in:
zhouwenxuan
2025-04-11 17:03:28 +08:00
parent 8ebf4e7225
commit 8a18ada09a

View File

@@ -221,14 +221,6 @@ class LibContentView extends React.Component {
} }
}; };
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.repoID !== this.props.repoID) {
this.setState({ path: '/', viewId: '', tagID: '', currentMode: cookie.load('seafile_view_mode') || LIST_MODE }, () => {
this.calculatePara(nextProps);
});
}
}
calculatePara = async (props) => { calculatePara = async (props) => {
const { repoID } = props; const { repoID } = props;
@@ -343,7 +335,10 @@ class LibContentView extends React.Component {
this.socket.close(); this.socket.close();
} }
componentDidUpdate() { componentDidUpdate(prevProps) {
if (prevProps.repoID !== this.props.repoID) {
this.calculatePara(this.props);
}
this.lastModifyTime = new Date(); this.lastModifyTime = new Date();
this.props.eventBus.dispatch(EVENT_BUS_TYPE.CURRENT_LIBRARY_CHANGED, { this.props.eventBus.dispatch(EVENT_BUS_TYPE.CURRENT_LIBRARY_CHANGED, {
repoID: this.props.repoID, repoID: this.props.repoID,