-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Stats Loading] Display cached data if there's no connection #11654
Conversation
@@ -236,6 +236,11 @@ import Reachability | |||
/// Public method to hide/show the image view. | |||
/// | |||
@objc func hideImageView(_ hide: Bool = true) { | |||
if let isReachable = reachability?.isReachable(), |
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.
Hey @danielebogo . I'm a little concerned about putting this here. hideImageView
is a public method that is called to essentially force the image to hide without question. A cursory search shows this is typically done based on device orientation, especially for iPhone landscape where there isn't a lot of space. On the views that expect the image to be hidden, it will instead be shown for no connection, which probably won't look very nice.
Thoughts?
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.
Ah! Good catch! Yes in that case I have to remove that.
I have a question about this. In func configureView()
, line 311, can the imageView.image
be nil by default?
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.
Nevermind @ScoutHarris ! I came up with another solution!
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.
I fixed it in 7ae9a3f.
You were right and that check was out of scope.
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.
Hey @danielebogo . Looks good!
# Conflicts: # WordPress/Classes/ViewRelated/Stats/StatsViewController.m
This PR removes the NRV from the
StatsViewController
if there's no connection only if the feature flag is enabled. Cached data will be displayed instead (if it does exist).To test:
• Install a fresh version of the App
• Put the phone in airplane mode
• Select stats. You should see the NRV (no connection)
• Tap back and switch off the airplane mode
• Select Stats and leave the insights load the data
• Tap back and put the phone in airplane mode
• Select Stats and you should see the cached data
Update release notes:
RELEASE-NOTES.txt
.