Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit cors proxy url in app component #43

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

atefBB
Copy link

@atefBB atefBB commented Jul 25, 2021

No description provided.

@@ -22,8 +23,7 @@ const App = ({ fetching }) => {

const getFeed = (event) => {
setFetching((prev) => !prev);
if (event.preventDefault != null)
event.preventDefault();
if (event.preventDefault != null) event.preventDefault();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change the condition to be if (event.preventDefault)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be clear to compare it with null instead of implicitly assume that !

{error ? renderAlert() : <div />}
{!past ? <p>Please enter an RSS feed</p> : <div></div>}
{error ? renderAlert() : null}
{!past ? <p>Please enter an RSS feed</p> : null}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use && operator !past && <p>Please enter an RSS feed</p>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just a cleaner way to do it !

@@ -9,8 +9,12 @@ export default function SearchHistory(props) {
};

const handleClose = (event) => {
if (event.currentTarget.innerText != '')
props.getFeed({target: {elements: {feed_url: {value: event.currentTarget.innerText}}}});
if (event.currentTarget.innerText !== "")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change the if statement to if (event.currentTarget.innerText)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as #43 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants