weex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guris...@apache.org
Subject [1/6] incubator-weex git commit: * [ios] add config to clear data when did receive response [Forced Update!]
Date Sun, 01 Oct 2017 03:09:59 GMT
Repository: incubator-weex
Updated Branches:
  refs/heads/release-0.16 bc821f356 -> 122aae12d (forced update)


* [ios] add config to clear data when did receive response


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/70098ce3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/70098ce3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/70098ce3

Branch: refs/heads/release-0.16
Commit: 70098ce3a1871a40d8fca64ccddddcbb1be549b7
Parents: bf3ab44
Author: acton393 <zhangxing610321@gmail.com>
Authored: Sat Sep 30 17:38:18 2017 +0800
Committer: acton393 <zhangxing610321@gmail.com>
Committed: Sat Sep 30 17:38:18 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/70098ce3/ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m b/ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m
index e3b58fd..9015625 100644
--- a/ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m
+++ b/ios/sdk/WeexSDK/Sources/Loader/WXResourceLoader.m
@@ -22,6 +22,8 @@
 #import "WXLog.h"
 #import "WXHandlerFactory.h"
 #import "WXSDKError.h"
+#import "WXConfigCenterProtocol.h"
+#import "WXSDKEngine.h"
 
 //deprecated
 #import "WXNetworkProtocol.h"
@@ -138,6 +140,14 @@
     WXLogDebug(@"request:%@ didReceiveResponse:%@ ", request, response);
     
     _response = response;
+    id<WXConfigCenterProtocol> configCenter = [WXSDKEngine handlerForProtocol:@protocol(WXConfigCenterProtocol)];
+    if ([configCenter respondsToSelector:@selector(configForKey:defaultValue:isDefault:)])
{
+        BOOL isDefault;
+        BOOL clearResponseData = [[configCenter configForKey:@"iOS_weex_ext_config.clearResponseDataWhenDidReceiveResponse"
defaultValue:@(NO) isDefault:&isDefault] boolValue];
+        if(clearResponseData) {
+            _data = nil;
+        }
+    }
     
     if (self.onResponseReceived) {
         self.onResponseReceived(response);


Mime
View raw message