[ 
https://issues.apache.org/jira/browse/CB-11554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15410323#comment-15410323
 ] 

Shazron Abdullah edited comment on CB-11554 at 8/6/16 12:32 AM:
----------------------------------------------------------------

The code needs to be re-factored so it can be testable -- namely these lines: 
https://github.com/apache/cordova-plugin-wkwebview-engine/blob/dce192abdf24d631a37e1ace9fe5b72b44c74ecf/src/ios/CDVWKWebViewEngine.m#L106-L108
... should exist in method called "shouldReloadWebView" which returns a BOOL, 
delete the reloadIfRequired method, and the rest of the code would be:
{code}
- (void) onAppWillEnterForeground:(NSNotification*)notification {
        if ([self shouldReloadWebView]) {
             NSLog(@"%@", @"CDVWKWebViewEngine reloading!");
             [wkWebView reload];
     }
 }
{code}


was (Author: shazron):
The code needs to be re-factored so it can be testable -- namely these lines: 
https://github.com/apache/cordova-plugin-wkwebview-engine/blob/dce192abdf24d631a37e1ace9fe5b72b44c74ecf/src/ios/CDVWKWebViewEngine.m#L106-L108
... should exist in method called "shouldReloadWebView" which returns a BOOL, 
remove reloadIfRequired, and the rest of the code would be:
{code}
- (void) onAppWillEnterForeground:(NSNotification*)notification {
        if ([self shouldReloadWebView]) {
             NSLog(@"%@", @"CDVWKWebViewEngine reloading!");
             [wkWebView reload];
     }
 }
{code}

> too "brutal" app reload when title is empty
> -------------------------------------------
>
>                 Key: CB-11554
>                 URL: https://issues.apache.org/jira/browse/CB-11554
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin WKWebViewEngine
>    Affects Versions: 1.0.4-dev
>            Reporter: Philippe Wang
>            Assignee: Shazron Abdullah
>              Labels: iOS, ios, regression, triaged
>
> This patch 
> https://github.com/apache/cordova-plugin-wkwebview-engine/commit/815ed0741b9ae30b343d6429bd8ff2ad37ec5790
> introduces {if title is empty then reload the app}.
> It was really hard for me to find the reason why the app I'm working on kept 
> reloading on each resume, while I had an older build of my app not having 
> this bad feature. Shouldn't there be at least a warning message explaining 
> why the app reloads? It'd be even better to find some better criteria.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to