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

Added mark email as read & close button #35

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Added mark email as read & close button #35

wants to merge 4 commits into from

Conversation

cbvvrd
Copy link
Contributor

@cbvvrd cbvvrd commented Nov 1, 2024

Emails now update to read once opened. Close button added to email view to take you back to the home page.

})
}

function markEmailRead() {
fetch(`https://email-client-api.dev.io-academy.uk/emails/${id}`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to only send this request if the email is not read - since you already have isRead it should be a case of just putting this fetch in an if statement.

It's not a big deal since the API doesn't really do anything if the email is already read, it's just a nice thing to do from an efficiency perspective.

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.

3 participants