From df34a407a3764782e0f8a84229759c914676e007 Mon Sep 17 00:00:00 2001 From: Bhavya Bansal Date: Sun, 16 Aug 2020 10:50:38 -0400 Subject: [PATCH] removing console.log and fixing issues with Details Component --- src/Details.js | 8 ++++---- src/SearchParams.js | 5 +---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Details.js b/src/Details.js index f083b1dc..29f34388 100644 --- a/src/Details.js +++ b/src/Details.js @@ -21,11 +21,11 @@ class Details extends React.Component { }`, description: animal.description, media: animal.photos, - breed: animal.breeds.primary, - loading: false + breed: animal.breeds.primary }); }) - .catch(err => this.setState({ error: err })); + .catch(err => this.setState({ error: err })) + .finally(() => this.setState({ loading: false })); } toggleModal = () => this.setState({ showModal: !this.state.showModal }); adopt = () => navigate(this.state.url); @@ -82,4 +82,4 @@ export default function DetailsErrorBoundary(props) {
); -} \ No newline at end of file +} diff --git a/src/SearchParams.js b/src/SearchParams.js index e8625a2a..e4c6db9a 100644 --- a/src/SearchParams.js +++ b/src/SearchParams.js @@ -18,9 +18,6 @@ const SearchParams = () => { breed, type: animal }); - - console.log("animals", animals); - setPets(animals || []); } @@ -73,4 +70,4 @@ const SearchParams = () => { ); }; -export default SearchParams; \ No newline at end of file +export default SearchParams;