fix(ios): fix ui function callback error

This commit is contained in:
luomy
2022-01-17 17:39:13 +08:00
committed by churchill-zhang
parent d1d34da094
commit a41da38daa
5 changed files with 17 additions and 12 deletions
File diff suppressed because one or more lines are too long
@@ -135,7 +135,10 @@ Hippy.document = {
},
callUIFunction(id, name, param, cb) {
global.ConsoleModule.debug(`callUIFunction id = ${id}, name = ${name}, param = ${JSON.stringify(param)}`);
UIManagerModule.CallUIFunction(id, name, param, cb);
const newcb = function (arr) {
cb.apply(null, arr);
};
UIManagerModule.CallUIFunction(id, name, param, newcb);
},
sendRenderError(error) {
if (error) {
File diff suppressed because one or more lines are too long
@@ -74,7 +74,9 @@ void NativeRenderManager::CallFunction(std::weak_ptr<DomNode> dom_node, const st
if (node) {
DomValue dom_value;
param.ToObject(dom_value);
// [uiManager_ dispatchFunction:name viewName:node->GetViewName() viewTag:node->GetId() params:dom_value callback:cb];
[uiManager_ dispatchFunction:name viewName:node->GetViewName()
viewTag:node->GetId() params:dom_value
callback:node->GetCallback(name, cb)];
}
EndBatch();
}
+1 -1
View File
@@ -40,7 +40,7 @@ using DomArgument = hippy::DomArgument;
@implementation NSArray (DomArgument)
- (DomValue)toDomValue {
DomValue::DomValueArrayType array([self count]);
DomValue::DomValueArrayType array;
for (NSObject *obj in self) {
array.push_back([obj toDomValue]);
}