Mhurd has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89138


Change subject: Fix for the double-refresh issue on My Uploads page.
......................................................................

Fix for the double-refresh issue on My Uploads page.

It was pretty simple - the refresh control was being added each time the My 
Uploads view appeared rather than once when the My Uploads view controller had 
finished loading.

Change-Id: I9b208136f81619ff1544f2df0e791b2e124aff07
---
M Commons-iOS/MyUploadsViewController.m
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons 
refs/changes/38/89138/1

diff --git a/Commons-iOS/MyUploadsViewController.m 
b/Commons-iOS/MyUploadsViewController.m
index 9a24b4e..c854712 100644
--- a/Commons-iOS/MyUploadsViewController.m
+++ b/Commons-iOS/MyUploadsViewController.m
@@ -56,6 +56,7 @@
     if (self) {
         thumbnailCount_ = 0;
         self.wantsFullScreenLayout = YES;
+        self.refreshControl = nil;
     }
     return self;
 }
@@ -66,11 +67,6 @@
 {
     [super viewDidAppear:animated];
 
-    // Set up refresh
-    self.refreshControl = [[UIRefreshControl alloc] init];
-    [self.refreshControl addTarget:self action:@selector(refreshButtonPushed:)
-                  forControlEvents:UIControlEventValueChanged];
-    [self.collectionView addSubview:self.refreshControl];
     self.refreshControl.hidden = YES;
 
     if (thumbnailCount_ != 0){
@@ -168,6 +164,12 @@
     // Change back button to be an arrow
     self.navigationItem.leftBarButtonItem = [[CommonsApp singleton] 
getBackButtonItemWithTarget:self action:@selector(backButtonPressed:)];
     
+    // Set up refresh
+    self.refreshControl = [[UIRefreshControl alloc] init];
+    [self.refreshControl addTarget:self action:@selector(refreshButtonPushed:)
+                  forControlEvents:UIControlEventValueChanged];
+    [self.collectionView addSubview:self.refreshControl];
+    
     //[self.view randomlyColorSubviews];
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/89138
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b208136f81619ff1544f2df0e791b2e124aff07
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/commons
Gerrit-Branch: master
Gerrit-Owner: Mhurd <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to