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 /> <antd.Divider />
<div className="field"> <div className="field">
<antd.Button {
onClick={props.onDeletePlaylist} props.playlist._id && <antd.Button
icon={<Icons.MdDelete />} onClick={props.onDeletePlaylist}
danger icon={<Icons.MdDelete />}
> danger
Delete Playlist >
</antd.Button> Delete Playlist
</antd.Button>
}
</div> </div>
</div> </div>
</div> </div>

View File

@ -121,6 +121,10 @@ export default class PlaylistCreatorSteps extends React.Component {
if (result) { if (result) {
app.message.success("Playlist published") app.message.success("Playlist published")
if (typeof this.props.onModification === "function") {
this.props.onModification()
}
if (typeof this.props.close === "function") { if (typeof this.props.close === "function") {
this.props.close() this.props.close()
} }
@ -250,6 +254,10 @@ export default class PlaylistCreatorSteps extends React.Component {
if (result) { if (result) {
app.message.success("Playlist deleted") app.message.success("Playlist deleted")
if (typeof this.props.onModification === "function") {
this.props.onModification()
}
if (typeof this.props.close === "function") { if (typeof this.props.close === "function") {
this.props.close() this.props.close()
} }