mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 09:51:26 +00:00
fix currentMode state modified by accident (#7471)
* fix currentMode state modified by accident * change parameter text --------- Co-authored-by: zhouwenxuan <aries@Mac.local> Co-authored-by: Michael An <2331806369@qq.com>
This commit is contained in:
@@ -170,9 +170,14 @@ class LibContentView extends React.Component {
|
|||||||
const { repoID } = props;
|
const { repoID } = props;
|
||||||
|
|
||||||
const { path, viewId, tagId } = this.getInfoFromLocation(repoID);
|
const { path, viewId, tagId } = this.getInfoFromLocation(repoID);
|
||||||
let currentMode = cookie.load('seafile_view_mode') || LIST_MODE;
|
let currentMode;
|
||||||
if (viewId) currentMode = METADATA_MODE;
|
if (tagId) {
|
||||||
if (tagId) currentMode = TAGS_MODE;
|
currentMode = TAGS_MODE;
|
||||||
|
} else if (viewId) {
|
||||||
|
currentMode = METADATA_MODE;
|
||||||
|
} else {
|
||||||
|
currentMode = cookie.load('seafile_view_mode') || LIST_MODE;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const repoInfo = await this.fetchRepoInfo(repoID);
|
const repoInfo = await this.fetchRepoInfo(repoID);
|
||||||
@@ -1997,20 +2002,22 @@ class LibContentView extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
resetSelected = (node) => {
|
resetSelected = (node) => {
|
||||||
const currentModel = this.state.currentMode;
|
if (node.object?.type === 'file') return;
|
||||||
const path = node.path || '';
|
const path = node.path || '';
|
||||||
let nextModel = cookie.load('seafile_view_mode') || LIST_MODE;
|
const currentMode = this.state.currentMode;
|
||||||
if (currentModel === METADATA_MODE && path.startsWith('/' + PRIVATE_FILE_TYPE.FILE_EXTENDED_PROPERTIES + '/')) {
|
let nextMode;
|
||||||
nextModel = METADATA_MODE;
|
if (currentMode === TAGS_MODE && path.startsWith('/' + PRIVATE_FILE_TYPE.TAGS_PROPERTIES + '/')) {
|
||||||
}
|
nextMode = TAGS_MODE;
|
||||||
if (currentModel === TAGS_MODE && path.startsWith('/' + PRIVATE_FILE_TYPE.TAGS_PROPERTIES + '/')) {
|
} else if (currentMode === METADATA_MODE && path.startsWith('/' + PRIVATE_FILE_TYPE.FILE_EXTENDED_PROPERTIES + '/')) {
|
||||||
nextModel = TAGS_MODE;
|
nextMode = METADATA_MODE;
|
||||||
|
} else {
|
||||||
|
nextMode = cookie.load('seafile_view_mode') || LIST_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isDirentSelected: false,
|
isDirentSelected: false,
|
||||||
isAllDirentSelected: false,
|
isAllDirentSelected: false,
|
||||||
currentMode: nextModel,
|
currentMode: nextMode,
|
||||||
currentDirent: null,
|
currentDirent: null,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user