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

[Stats Loading] Display cached data if there's no connection #11654

Merged
merged 7 commits into from
May 10, 2019

Conversation

danielebogo
Copy link
Contributor

@danielebogo danielebogo commented May 8, 2019

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:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@danielebogo danielebogo requested a review from ScoutHarris May 9, 2019 09:43
@danielebogo danielebogo marked this pull request as ready for review May 9, 2019 09:44
@@ -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(),
Copy link
Contributor

@ScoutHarris ScoutHarris May 9, 2019

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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!

Copy link
Contributor Author

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.

@danielebogo danielebogo requested a review from ScoutHarris May 9, 2019 18:47
Copy link
Contributor

@ScoutHarris ScoutHarris left a 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!

:shipit:

# Conflicts:
#	WordPress/Classes/ViewRelated/Stats/StatsViewController.m
@danielebogo danielebogo merged commit d378333 into develop May 10, 2019
@danielebogo danielebogo deleted the issues/10840-offline-view branch May 10, 2019 08:31
@ScoutHarris ScoutHarris mentioned this pull request May 10, 2019
45 tasks
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