Skip to content

Commit

Permalink
optimise codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael18811380328 committed Dec 10, 2024
1 parent e9a06b1 commit f037008
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/pages/wiki2/side-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ class SidePanel extends PureComponent {
const config = deepCopy(this.props.config);
const { pages } = config;
const index = PageUtils.getPageIndexById(pageId, pages);
const deletePageName = pages[index].name;
config.pages.splice(index, 1);
wikiAPI.deleteWiki2Page(wikiId, pageId).then((res) => {
if (res.data.success === true) {
this.props.updateWikiConfig(config);
toaster.success(
<span>
{gettext('xxx page deleted').replace('xxx', pages[index].name)}
{gettext('xxx page deleted').replace('xxx', deletePageName)}
<CommonUndoTool onUndoOperation={() => this.revertWikiPage(pageId)} />
</span>
);
Expand Down

0 comments on commit f037008

Please sign in to comment.