Skip to content

Commit

Permalink
delete wiki page do not jump to first page (#7092)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 authored Nov 23, 2024
1 parent 3643966 commit af56e31
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions frontend/src/pages/wiki2/side-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ class SidePanel extends PureComponent {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
if (config.pages.length > 0) {
this.props.setCurrentPage(config.pages[0].id);
} else {
this.props.setCurrentPage('');
if (this.props.getCurrentPageId() === pageId) {
const newPageId = config.pages.length > 0 ? config.pages[0].id : '';
this.props.setCurrentPage(newPageId);
}
};

Expand Down

0 comments on commit af56e31

Please sign in to comment.