From ac277479bf1a1acd02f892630144a10c2a4c38b5 Mon Sep 17 00:00:00 2001 From: Todd McNeal Date: Mon, 14 Dec 2020 14:21:27 -0500 Subject: [PATCH] Show confirm modal when creating channel --- services/web/src/views/main/main.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/services/web/src/views/main/main.js b/services/web/src/views/main/main.js index 7193916..446126f 100644 --- a/services/web/src/views/main/main.js +++ b/services/web/src/views/main/main.js @@ -23,10 +23,12 @@ class NewChannelLightbox extends React.Component {
{ e.preventDefault(); - - this.props.onChannelCreate({name: this.state.channelName, description: this.state.channelDescription}); - this.setState({channelName: "", channelDescription: ""}); - this.props.onClose(); + + if (window.confirm("Are you sure you want to create a new channel?")) { + this.props.onChannelCreate({name: this.state.channelName, description: this.state.channelDescription}); + this.setState({channelName: "", channelDescription: ""}); + this.props.onClose(); + } }}>