From f037008ecc14b3d2ac3cf10830ff3c9353e5aef4 Mon Sep 17 00:00:00 2001 From: Michael An <2331806369@qq.com> Date: Tue, 10 Dec 2024 16:59:44 +0800 Subject: [PATCH] optimise codes --- frontend/src/pages/wiki2/side-panel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/wiki2/side-panel.js b/frontend/src/pages/wiki2/side-panel.js index 5a98bedf6f..e730608678 100644 --- a/frontend/src/pages/wiki2/side-panel.js +++ b/frontend/src/pages/wiki2/side-panel.js @@ -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( - {gettext('xxx page deleted').replace('xxx', pages[index].name)} + {gettext('xxx page deleted').replace('xxx', deletePageName)} this.revertWikiPage(pageId)} /> );