Skip to content

Commit

Permalink
feat: prevent deletion of the last sequence (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMercy235 committed Mar 28, 2020
1 parent 213ccc7 commit a16180a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ class WriteStoryComponent extends Component {
};

onOpenDeleteSeqModal = (e, seqId) => {
const { onDeleteSequenceModalOpen } = this.props;
const { sequences, onDeleteSequenceModalOpen } = this.props;
e.preventDefault();
if (sequences.length === 1) {
return;
}
onDeleteSequenceModalOpen(seqId);
};

Expand Down

0 comments on commit a16180a

Please sign in to comment.