diff --git a/js/components/addEditBookmark.js b/js/components/addEditBookmark.js index 8439a6732bd..22515087c85 100644 --- a/js/components/addEditBookmark.js +++ b/js/components/addEditBookmark.js @@ -32,12 +32,10 @@ class AddEditBookmark extends ImmutableComponent { get isBlankTab () { return ['about:blank', 'about:newtab'].includes(this.props.currentDetail.get('location')) } - get bookmarkNameValid () { let title = (this.props.currentDetail.get('title') || this.props.currentDetail.get('customTitle')) return ((typeof title === 'string') && title.trim().length > 0) } - get isFolder () { return siteUtil.isFolder(this.props.currentDetail) } @@ -102,10 +100,10 @@ class AddEditBookmark extends ImmutableComponent { } onSave () { // First check if the title of the currentDetail is set - if (!this.bookmarkNameValid) { + if (this.isFolder && !this.bookmarkNameValid) { return false } - + this.showToolbarOnFirstBookmark() const tag = this.isFolder ? siteTags.BOOKMARK_FOLDER : siteTags.BOOKMARK appActions.addSite(this.props.currentDetail, tag, this.props.originalDetail, this.props.destinationDetail) @@ -121,7 +119,11 @@ class AddEditBookmark extends ImmutableComponent { if (this.props.currentDetail.get('customTitle') !== undefined) { return this.props.currentDetail.get('customTitle') } - return this.props.currentDetail.get('title') || this.props.currentDetail.get('location') + return '' + } + get placeholderName () { + let title = this.props.currentDetail.get('title') + return title ? title : this.props.currentDetail.get('location') } render () { return @@ -129,7 +131,7 @@ class AddEditBookmark extends ImmutableComponent {
{ !this.isFolder @@ -155,7 +157,7 @@ class AddEditBookmark extends ImmutableComponent { ? : null } -