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

Add go to downloads button in home if there is no connection #1438

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

Conversation

Luna712
Copy link
Contributor

@Luna712 Luna712 commented Dec 27, 2024

No description provided.

@@ -590,7 +592,16 @@ class HomeFragment : Fragment() {

is Resource.Failure -> {
homeLoadingShimmer.stopShimmer()
resultErrorText.text = data.errorString
var errorString = data.errorString
if (context?.isNetworkAvailable() == false) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just use isNetworkError or extend the Resource.Failure and check the exception type of the error. This is because isNetworkAvailable is not always correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That actually seems to be more inaccurate though. IE if DNS fails but you actually have connection it is the same error as it is a network error, whereas what I currently use does it only if device has no service.

@fire-light42
Copy link
Collaborator

Cant you just always show the "go to downloads instead" button, no matter the error?

@Luna712
Copy link
Contributor Author

Luna712 commented Jan 4, 2025

Cant you just always show the "go to downloads instead" button, no matter the error?

Could but what I wanted to avoid is the open in browser button if no connection as well.

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