You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/19 04:25:00 UTC
[1/2] incubator-weex git commit: * [ios] parse fetch response while
the callback is existed
Repository: incubator-weex
Updated Branches:
refs/heads/master ebd058eb1 -> aaa1bdbad
* [ios] parse fetch response while the callback is existed
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b16b9760
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b16b9760
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b16b9760
Branch: refs/heads/master
Commit: b16b9760aeb5eed40f00ce22dd38520bbe491372
Parents: b7383a4
Author: acton393 <zh...@gmail.com>
Authored: Wed Oct 18 11:04:28 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Oct 18 11:09:17 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b16b9760/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
index 4b01cde..bd96806 100644
--- a/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
+++ b/ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m
@@ -85,20 +85,16 @@ WX_EXPORT_METHOD(@selector(fetchWithArrayBuffer:options:callback:progressCallbac
};
loader.onFinished = ^(const WXResourceResponse * response, NSData *data) {
- if (weakSelf) {
- [weakSelf _loadFinishWithResponse:[response copy] data:data callbackRsp:callbackRsp];
- if (callback) {
- callback(callbackRsp);
- }
+ if (weakSelf && callback) {
+ [weakSelf _loadFinishWithResponse:[response copy] data:data callbackRsp:callbackRsp];
+ callback(callbackRsp);
}
};
loader.onFailed = ^(NSError *error) {
- if (weakSelf) {
+ if (weakSelf && callback) {
[weakSelf _loadFailedWithError:error callbackRsp:callbackRsp];
- if (callback) {
- callback(callbackRsp);
- }
+ callback(callbackRsp);
}
};
@@ -268,7 +264,7 @@ WX_EXPORT_METHOD(@selector(fetchWithArrayBuffer:options:callback:progressCallbac
NSError * error = nil;
id jsonObj = [WXUtility JSONObject:data error:&error];
if (error) {
- WXLogError(@"%@", [error description]);
+ WXLogDebug(@"%@", [error description]);
}
return jsonObj;
}
[2/2] incubator-weex git commit: * [ios] parse fetch response while
the callback is existed
Posted by gu...@apache.org.
* [ios] parse fetch response while the callback is existed
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/aaa1bdba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/aaa1bdba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/aaa1bdba
Branch: refs/heads/master
Commit: aaa1bdbada2053afe8407e776ca2bd770f87302d
Parents: ebd058e b16b976
Author: gurisxie <27...@qq.com>
Authored: Thu Oct 19 12:22:55 2017 +0800
Committer: gurisxie <27...@qq.com>
Committed: Thu Oct 19 12:23:32 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
----------------------------------------------------------------------