Fixed: Goodreads bookshelves not shown after authentication

pull/770/head
ta264 3 years ago committed by Qstick
parent 93ba5ade9e
commit 64e2f6457d

@ -182,7 +182,8 @@ BookshelfInput.propTypes = {
BookshelfInput.defaultProps = {
className: styles.bookshelfInputWrapper,
inputClassName: styles.input
inputClassName: styles.input,
isPopulated: false
};
export default BookshelfInput;

@ -3,22 +3,22 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { clearOptions, fetchOptions } from 'Store/Actions/providerOptionActions';
import { clearOptions, defaultState, fetchOptions } from 'Store/Actions/providerOptionActions';
import BookshelfInput from './BookshelfInput';
function createMapStateToProps() {
return createSelector(
(state) => state.providerOptions,
(state) => state.providerOptions.bookshelves || defaultState,
(state, props) => props.name,
(state, name) => {
(bookshelves, name) => {
const {
items,
...otherState
} = state;
} = bookshelves;
return ({
helptext: items.helptext && items.helptext[name] ? items.helptext[name] : '',
user: items.user ? items.user : '',
items: items.shelves ? items.shelves : [],
user: items && items.user ? items.user : '',
items: items && items.shelves ? items.shelves : [],
...otherState
});
}
@ -50,7 +50,7 @@ class BookshelfInputConnector extends Component {
}
componentWillUnmount = () => {
this.props.dispatchClearOptions();
this.props.dispatchClearOptions({ section: 'bookshelves' });
}
//
@ -65,6 +65,7 @@ class BookshelfInputConnector extends Component {
} = this.props;
dispatchFetchOptions({
section: 'bookshelves',
action: 'getBookshelves',
queryParams: { name },
provider,

Loading…
Cancel
Save