fixed check password to match check channel
This commit is contained in:
parent
bbd455f4a1
commit
6414142f73
1 changed files with 3 additions and 4 deletions
|
@ -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...'});
|
||||||
|
|
Loading…
Reference in a new issue