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

repair rename bug (#3046)

This commit is contained in:
杨顺强
2019-03-05 13:36:31 +08:00
committed by Daniel Pan
parent adf8795148
commit e08aa4d91f

View File

@@ -850,7 +850,8 @@ class LibContentView extends React.Component {
// example: direntPath = /A/B/C, state.path = /A/B/C
this.setState({ path: newDirentPath });
let url = siteRoot + 'wiki/lib/' + repoID + newDirentPath;
let repoInfo = this.state.currentRepoInfo;
let url = siteRoot + 'library/' + repoID + '/' + encodeURIComponent(repoInfo.repo_name) + newDirentPath;
window.history.replaceState({ url: url, path: newDirentPath}, newDirentPath, url);
} else if (Utils.isChildPath(direntPath, this.state.path)) {
// example: direntPath = /A/B/C/D, state.path = /A/B/C
@@ -868,7 +869,8 @@ class LibContentView extends React.Component {
let newPath = Utils.renameAncestorPath(this.state.path, direntPath, newDirentPath);
this.setState({ path: newPath });
let url = siteRoot + 'wiki/lib/' + repoID + newPath;
let repoInfo = this.state.currentRepoInfo;
let url = siteRoot + 'library/' + repoID + '/' + encodeURIComponent(repoInfo.repo_name) + newPath;
window.history.replaceState({ url: url, path: newPath}, newPath, url);
}
}