Skip to content

Commit

Permalink
fix objc -> javascript response code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswestin committed Oct 7, 2012
1 parent 108bb67 commit 01719a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.js.txt
Expand Up @@ -70,11 +70,11 @@
if (message.callbackId) {
var callbackResponseId = message.callbackId
response = {
respondWith: function(data) {
_doSend({ responseId:callbackResponseId, data:data })
respondWith: function(responseData) {
_doSend({ responseId:callbackResponseId, responseData:responseData })
},
respondWithError: function(error) {
_doSend({ responseId:callbackResponseId, data:data })
_doSend({ responseId:callbackResponseId, error:error })
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion WebViewJavascriptBridge/WebViewJavascriptBridge.m
Expand Up @@ -113,7 +113,7 @@ - (void)_flushMessageQueue {
NSString* responseId = [message objectForKey:@"responseId"];
if (responseId) {
WVJBResponseCallback responseCallback = [_responseCallbacks objectForKey:responseId];
responseCallback([message objectForKey:@"error"], [message objectForKey:@"data"]);
responseCallback([message objectForKey:@"error"], [message objectForKey:@"responseData"]);
[_responseCallbacks removeObjectForKey:responseId];
} else {
WVJBResponse* response = nil;
Expand Down

0 comments on commit 01719a5

Please sign in to comment.