-
Notifications
You must be signed in to change notification settings - Fork 567
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
base: master
Are you sure you want to change the base?
Conversation
@@ -590,7 +592,16 @@ class HomeFragment : Fragment() { | |||
|
|||
is Resource.Failure -> { | |||
homeLoadingShimmer.stopShimmer() | |||
resultErrorText.text = data.errorString | |||
var errorString = data.errorString | |||
if (context?.isNetworkAvailable() == false) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
No description provided.