mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 09:21:54 +00:00
fix: reback
This commit is contained in:
@@ -169,7 +169,10 @@ class LibContentView extends React.Component {
|
||||
calculatePara = async (props) => {
|
||||
const { repoID } = props;
|
||||
|
||||
const path = this.getPathFromLocation(repoID);
|
||||
const { path, viewId, tagId } = this.getInfoFromLocation(repoID);
|
||||
let currentMode = cookie.load('seafile_view_mode') || LIST_MODE;
|
||||
if (viewId) currentMode = METADATA_MODE;
|
||||
if (tagId) currentMode = TAGS_MODE;
|
||||
|
||||
try {
|
||||
const repoInfo = await this.fetchRepoInfo(repoID);
|
||||
@@ -181,8 +184,11 @@ class LibContentView extends React.Component {
|
||||
repoName: repoInfo.repo_name,
|
||||
libNeedDecrypt: repoInfo.lib_need_decrypt,
|
||||
repoEncrypted: repoInfo.encrypted,
|
||||
isGroupOwnedRepo: isGroupOwnedRepo,
|
||||
path: path
|
||||
isGroupOwnedRepo,
|
||||
path,
|
||||
viewId,
|
||||
tagId,
|
||||
currentMode,
|
||||
});
|
||||
|
||||
if (this.state.isTreePanelShown) {
|
||||
@@ -203,13 +209,13 @@ class LibContentView extends React.Component {
|
||||
}
|
||||
};
|
||||
|
||||
getPathFromLocation = (repoID) => {
|
||||
getInfoFromLocation = (repoID) => {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const viewID = urlParams.get('view');
|
||||
if (viewID) return `/${PRIVATE_FILE_TYPE.FILE_EXTENDED_PROPERTIES}`;
|
||||
const viewId = urlParams.get('view');
|
||||
if (viewId) return { path: `/${PRIVATE_FILE_TYPE.FILE_EXTENDED_PROPERTIES}`, viewId };
|
||||
|
||||
const tagID = urlParams.get('tag');
|
||||
if (tagID) return `/${PRIVATE_FILE_TYPE.TAGS_PROPERTIES}`;
|
||||
const tagId = urlParams.get('tag');
|
||||
if (tagId) return { path: `/${PRIVATE_FILE_TYPE.TAGS_PROPERTIES}`, tagId };
|
||||
|
||||
let location = window.location.href.split('?')[0];
|
||||
location = decodeURIComponent(location);
|
||||
@@ -218,7 +224,7 @@ class LibContentView extends React.Component {
|
||||
if (path.length > 1 && path.endsWith('/')) {
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
return path;
|
||||
return { path };
|
||||
};
|
||||
|
||||
fetchRepoInfo = async (repoID) => {
|
||||
@@ -520,9 +526,10 @@ class LibContentView extends React.Component {
|
||||
|
||||
hideMetadataView = (isSetRoot = false) => {
|
||||
const { repoID } = this.props;
|
||||
const { path } = this.getInfoFromLocation(repoID);
|
||||
this.setState({
|
||||
currentMode: cookie.load('seafile_view_mode') || LIST_MODE,
|
||||
path: isSetRoot ? '/' : this.getPathFromLocation(repoID),
|
||||
path: isSetRoot ? '/' : path,
|
||||
viewId: '',
|
||||
tagId: '',
|
||||
currentDirent: isSetRoot ? null : this.state.currentDirent,
|
||||
|
Reference in New Issue
Block a user