improve modification logic

This commit is contained in:
SrGooglo 2023-05-31 19:33:31 +00:00
parent 2e627a2b71
commit 1ae44d6c86
2 changed files with 17 additions and 7 deletions

View File

@ -138,13 +138,15 @@ export default (props) => {
<antd.Divider />
<div className="field">
<antd.Button
onClick={props.onDeletePlaylist}
icon={<Icons.MdDelete />}
danger
>
Delete Playlist
</antd.Button>
{
props.playlist._id && <antd.Button
onClick={props.onDeletePlaylist}
icon={<Icons.MdDelete />}
danger
>
Delete Playlist
</antd.Button>
}
</div>
</div>
</div>

View File

@ -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()
}