Bgerstle has submitted this change and it was merged.

Change subject: Fix for too much whitespace beneath article title on landscape.
......................................................................


Fix for too much whitespace beneath article title on landscape.

To reproduce bug:

-load page with a lead image
-restart the app
-don't touch anything, just rotate landscape
-there should be the proper amount of whitespace beneath the title
-now rotate back to portrait and carefully tap once on some article whitespace
-now rotate landscape, there will be too much space beneath title

The problem was the com bridge's queueing flag was being set
to YES when non-page load messages were being sent. Also, in
the case a page load failed, the queueing flag was not being reset.

T91118

Change-Id: I3993c5c7f12604344c9d627fd29c7a3bb63f25d8
---
M Wikipedia/mw-bridge/CommunicationBridge.m
1 file changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Bgerstle: Verified; Looks good to me, approved



diff --git a/Wikipedia/mw-bridge/CommunicationBridge.m 
b/Wikipedia/mw-bridge/CommunicationBridge.m
index 2bb3cfe..fa7e200 100644
--- a/Wikipedia/mw-bridge/CommunicationBridge.m
+++ b/Wikipedia/mw-bridge/CommunicationBridge.m
@@ -111,7 +111,6 @@
 }
 
 - (BOOL)webView:(UIWebView*)webView 
shouldStartLoadWithRequest:(NSURLRequest*)request 
navigationType:(UIWebViewNavigationType)navigationType {
-    self.shouldQueueMessages = YES;
 
     if ([self isBridgeURL:request.URL]) {
         NSDictionary* message = [self extractBridgePayload:request.URL];
@@ -120,15 +119,15 @@
         [self fireEvent:messageType withPayload:payload];
         return NO;
     }
+
     return YES;
 }
 
 - (void)sendQueuedMessages {
-    self.shouldQueueMessages = NO;
     for (NSString* js in self.queuedMessages.copy) {
         [self sendRawMessage:js];
     }
-    [self.queuedMessages removeAllObjects];
+    [self disableQueueingAndRemoveQueuedMessages];
 }
 
 - (void)webViewDidStartLoad:(UIWebView*)webView {
@@ -137,6 +136,13 @@
 
 - (void)webView:(UIWebView*)webView didFailLoadWithError:(NSError*)error {
     NSLog(@"webView failed to load: %@", error);
+    [self disableQueueingAndRemoveQueuedMessages];
+}
+
+-(void)disableQueueingAndRemoveQueuedMessages {
+    
+    self.shouldQueueMessages = NO;
+    [self.queuedMessages removeAllObjects];
 }
 
 - (void)loadHTML:(NSString*)string withAssetsFile:(NSString*)fileName {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3993c5c7f12604344c9d627fd29c7a3bb63f25d8
Gerrit-PatchSet: 4
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <mh...@wikimedia.org>
Gerrit-Reviewer: Bgerstle <bgers...@wikimedia.org>
Gerrit-Reviewer: Dr0ptp4kt <ab...@wikimedia.org>
Gerrit-Reviewer: Fjalapeno <cfl...@wikimedia.org>
Gerrit-Reviewer: Mhurd <mh...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to