fixed check password to match check channel

This commit is contained in:
bill bittner 2018-03-12 11:45:16 -07:00
parent bbd455f4a1
commit 6414142f73

View file

@ -49,8 +49,7 @@ class ChannelCreateForm extends React.Component {
const channelWithAtSymbol = `@${channel}`; const channelWithAtSymbol = `@${channel}`;
return request(`/api/channel/availability/${channelWithAtSymbol}`); return request(`/api/channel/availability/${channelWithAtSymbol}`);
} }
checkIsPasswordProvided () { checkIsPasswordProvided (password) {
const password = this.state.password;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!password || password.length < 1) { if (!password || password.length < 1) {
return reject(new Error('Please provide a password')); return reject(new Error('Please provide a password'));
@ -79,9 +78,9 @@ class ChannelCreateForm extends React.Component {
} }
createChannel (event) { createChannel (event) {
event.preventDefault(); event.preventDefault();
this.checkIsPasswordProvided() this.checkIsPasswordProvided(this.state.password)
.then(() => { .then(() => {
return this.checkIsChannelAvailable(); return this.checkIsChannelAvailable(this.state.channel);
}) })
.then(() => { .then(() => {
this.setState({status: 'We are publishing your new channel. Sit tight...'}); this.setState({status: 'We are publishing your new channel. Sit tight...'});