提交 dd6e1c97 编写于 作者: fxy060608's avatar fxy060608

chore: merge

......@@ -22776,7 +22776,13 @@
}
function setPageReady() {
isPageReady = true;
pageReadyCallbacks.forEach((fn) => fn());
pageReadyCallbacks.forEach((fn) => {
try {
fn();
} catch (e2) {
console.error(e2);
}
});
pageReadyCallbacks.length = 0;
}
function onPageCreated() {
......@@ -22892,9 +22898,9 @@
case ACTION_TYPE_PAGE_CREATED:
return onPageCreated();
case ACTION_TYPE_CREATE:
return createElement(action[1], getDict(action[2]), action[3], action[4], decodeNodeJson(getDict, action[5]));
var parentNodeId = action[3];
return createElement(action[1], getDict(action[2]), parentNodeId === -1 ? 0 : parentNodeId, action[4], decodeNodeJson(getDict, action[5]));
case ACTION_TYPE_INSERT:
console.log('ACTION_TYPE_INSERT',ACTION_TYPE_INSERT,JSON.stringify(action))
return $(action[1]).insert(action[2], action[3]);
case ACTION_TYPE_REMOVE:
return $(action[1]).remove();
......
......@@ -58,10 +58,12 @@ function onPageUpdateSync(actions: (PageAction | DictAction)[]) {
case ACTION_TYPE_PAGE_CREATED:
return onPageCreated()
case ACTION_TYPE_CREATE:
const parentNodeId = action[3]
return createElement(
action[1],
getDict(action[2] as number),
action[3],
// 部分性能低的手机,createAction 与 insertAction 是分开的,导致根节点 parentNodeId 为 -1
parentNodeId === -1 ? 0 : parentNodeId,
action[4],
decodeNodeJson(getDict, action[5] as UniNodeJSONMinify)
)
......
......@@ -82,7 +82,13 @@ function setPageReady() {
console.log(formatLog('setPageReady', pageReadyCallbacks.length))
}
isPageReady = true
pageReadyCallbacks.forEach((fn) => fn())
pageReadyCallbacks.forEach((fn) => {
try {
fn()
} catch (e: unknown) {
console.error(e)
}
})
pageReadyCallbacks.length = 0
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册