Fixed: UI Errors in Add Book page

Fixes #1906
pull/1932/head
Qstick 2 years ago
parent f8324b3c92
commit 7c74a8df01

@ -148,11 +148,10 @@ class AddNewItem extends Component {
); );
} else if (item.book) { } else if (item.book) {
const book = item.book; const book = item.book;
const edition = book.editions.find((x) => x.monitored);
return ( return (
<AddNewBookSearchResultConnector <AddNewBookSearchResultConnector
key={item.id} key={item.id}
isExistingBook={'id' in edition && edition.id !== 0} isExistingBook={'id' in book && book.id !== 0}
isExistingAuthor={'id' in book.author && book.author.id !== 0} isExistingAuthor={'id' in book.author && book.author.id !== 0}
{...book} {...book}
/> />

@ -138,17 +138,20 @@ class AddNewBookSearchResult extends Component {
null null
} }
<Link {
className={styles.mbLink} editions && editions.length > 1 ?
to={`https://goodreads.com/book/show/${editions[0].foreignEditionId}`} <Link
onPress={this.onTVDBLinkPress} className={styles.mbLink}
> to={`https://goodreads.com/book/show/${editions[0].foreignEditionId}`}
<Icon onPress={this.onTVDBLinkPress}
className={styles.mbLinkIcon} >
name={icons.EXTERNAL_LINK} <Icon
size={28} className={styles.mbLinkIcon}
/> name={icons.EXTERNAL_LINK}
</Link> size={28}
/>
</Link> : null
}
</div> </div>
</div> </div>
@ -218,7 +221,7 @@ AddNewBookSearchResult.propTypes = {
overview: PropTypes.string, overview: PropTypes.string,
ratings: PropTypes.object.isRequired, ratings: PropTypes.object.isRequired,
author: PropTypes.object, author: PropTypes.object,
editions: PropTypes.arrayOf(PropTypes.object).isRequired, editions: PropTypes.arrayOf(PropTypes.object),
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,
isExistingBook: PropTypes.bool.isRequired, isExistingBook: PropTypes.bool.isRequired,
isExistingAuthor: PropTypes.bool.isRequired, isExistingAuthor: PropTypes.bool.isRequired,

@ -173,7 +173,7 @@ class AddAuthorOptionsForm extends Component {
AddAuthorOptionsForm.propTypes = { AddAuthorOptionsForm.propTypes = {
rootFolderPath: PropTypes.object, rootFolderPath: PropTypes.object,
monitor: PropTypes.object.isRequired, monitor: PropTypes.object.isRequired,
monitorNewItems: PropTypes.string.isRequired, monitorNewItems: PropTypes.object.isRequired,
qualityProfileId: PropTypes.object, qualityProfileId: PropTypes.object,
metadataProfileId: PropTypes.object, metadataProfileId: PropTypes.object,
showMetadataProfile: PropTypes.bool.isRequired, showMetadataProfile: PropTypes.bool.isRequired,

Loading…
Cancel
Save