diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index e8fe4833d7..dfda6edab7 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -1123,20 +1123,15 @@ class LibContentView extends React.Component { } else { this.loadNodeAndParentsByPath(path); } - - // load mainPanel - if (item.is_dir) { - this.showDir(path); - } else { - this.openSearchedNewTab(item); - } - } else { - if (item.is_dir) { - this.showDir(path); - } else { - this.openSearchedNewTab(item); - } } + + if (item.is_dir) { + this.setState({ currentMode: cookie.load('seafile_view_mode') || LIST_MODE }); + this.showDir(path); + } else { + this.openSearchedNewTab(item); + } + }; openSearchedNewTab = (item) => {