From 1ae44d6c861e383b39dfa089c1ab6dcc4bce7d31 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Wed, 31 May 2023 19:33:31 +0000 Subject: [PATCH] improve modification logic --- .../components/BasicInformation/index.jsx | 16 +++++++++------- packages/app/src/pages/music/creator/index.jsx | 8 ++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/app/src/pages/music/creator/components/BasicInformation/index.jsx b/packages/app/src/pages/music/creator/components/BasicInformation/index.jsx index 45c34428..38bc6f7a 100644 --- a/packages/app/src/pages/music/creator/components/BasicInformation/index.jsx +++ b/packages/app/src/pages/music/creator/components/BasicInformation/index.jsx @@ -138,13 +138,15 @@ export default (props) => {
- } - danger - > - Delete Playlist - + { + props.playlist._id && } + danger + > + Delete Playlist + + }
diff --git a/packages/app/src/pages/music/creator/index.jsx b/packages/app/src/pages/music/creator/index.jsx index 586ed685..798b4ae0 100755 --- a/packages/app/src/pages/music/creator/index.jsx +++ b/packages/app/src/pages/music/creator/index.jsx @@ -121,6 +121,10 @@ export default class PlaylistCreatorSteps extends React.Component { if (result) { app.message.success("Playlist published") + if (typeof this.props.onModification === "function") { + this.props.onModification() + } + if (typeof this.props.close === "function") { this.props.close() } @@ -250,6 +254,10 @@ export default class PlaylistCreatorSteps extends React.Component { if (result) { app.message.success("Playlist deleted") + if (typeof this.props.onModification === "function") { + this.props.onModification() + } + if (typeof this.props.close === "function") { this.props.close() }