1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 15:53:28 +00:00

Merge pull request #5855 from haiwen/add-internal-link

add-internal-link
This commit is contained in:
杨顺强
2023-12-28 10:40:16 +08:00
committed by GitHub
2 changed files with 13 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ import { Utils } from '../../utils/utils';
const propTypes = {
path: PropTypes.string.isRequired,
repoID: PropTypes.string.isRequired,
internalLink: PropTypes.string,
onInternalLinkDialogToggle: PropTypes.func.isRequired,
};
@@ -24,6 +25,10 @@ class InternalLinkDialog extends React.Component {
}
componentDidMount() {
if (this.props.internalLink) {
this.setState({smartLink: this.props.internalLink});
return;
}
this.getInternalLink();
}
@@ -51,7 +56,7 @@ class InternalLinkDialog extends React.Component {
};
toggle = () => {
this.props.onInternalLinkDialogToggle();
this.props.onInternalLinkDialogToggle({internalLink: ''});
};
render() {