fix: fetch suggestions

This commit is contained in:
Akuoko Daniel Jnr 2021-03-30 18:08:21 +00:00
parent 1adad7d273
commit dab8685e9d
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC
2 changed files with 14 additions and 4 deletions

View File

@ -299,8 +299,13 @@ class CarouselSidebarData extends React.Component {
};
updateSuggestions = () => {
let newSuggestions = new Set([...this.props.viewer.tags, ...this.state.tags]);
this.setState({ suggestions: Array.from(newSuggestions) });
if (Array.isArray(this.props.viewer.tags)) {
let newSuggestions = new Set([...this.props.viewer.tags, ...this.state.tags]);
this.setState({ suggestions: Array.from(newSuggestions) });
return;
}
this.setState({ suggestions: this.state.tag });
};
_handleDarkMode = async (e) => {

View File

@ -231,8 +231,13 @@ export default class CarouselSidebarSlate extends React.Component {
};
updateSuggestions = () => {
let newSuggestions = new Set([...this.props.viewer.tags, ...this.state.tags]);
this.setState({ suggestions: Array.from(newSuggestions) });
if (Array.isArray(this.props.viewer.tags)) {
let newSuggestions = new Set([...this.props.viewer.tags, ...this.state.tags]);
this.setState({ suggestions: Array.from(newSuggestions) });
return;
}
this.setState({ suggestions: this.state.tag });
};
_handleClose = () => {