diff --git a/js/page/publish.js b/js/page/publish.js index a47925da2..857fc1bb9 100644 --- a/js/page/publish.js +++ b/js/page/publish.js @@ -141,9 +141,9 @@ var PublishPage = React.createClass({ error.message); }, handleNameChange: function(event) { - var name = event.target.value; + var rawName = event.target.value; - if (!name) { + if (!rawName) { this.setState({ name: '', nameResolved: false, @@ -152,8 +152,11 @@ var PublishPage = React.createClass({ return; } + var name = lbry.formatName(rawName); + lbry.resolveName(name, (info) => { - if (name != this.refs.name.getValue()) { + if (name != lbry.formatName(this.refs.name.getValue())) { + // A new name has been typed already, so bail return; } @@ -285,9 +288,9 @@ var PublishPage = React.createClass({ lbry:// { (!this.state.name ? '' : - (! this.state.nameResolved ? This name is available: {this.state.name} - : (this.state.nameIsMine ? You already control this name. You can use this page to update your claim. - : This name is currently claimed for {lbry.formatCredits(this.state.claimValue)} credits.))) + (! this.state.nameResolved ? The name {this.state.name} is available. + : (this.state.nameIsMine ? You already control the name {this.state.name}. You can use this page to update your claim. + : The name {this.state.name} is currently claimed for {lbry.formatCredits(this.state.claimValue)} credits.))) }
What LBRY name would you like to claim for this file?