Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Fix heron event (#2747)
Browse files Browse the repository at this point in the history
* Do not check page in CreateFinish and RenderSuccess.

* Send create finish event to heron page vir dom module.
  • Loading branch information
wqyfavor authored and jianhan-he committed Jul 26, 2019
1 parent 5ea0466 commit a0aae4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
24 changes: 12 additions & 12 deletions ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
Expand Up @@ -757,9 +757,6 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
int IOSSide::CreateFinish(const char* pageId)
{
RenderPageBase *page = RenderManager::GetInstance()->GetPage(pageId);
if (page == nullptr) {
return -1;
}

long long startTime = getCurrentTime();

Expand All @@ -776,16 +773,15 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
[manager startComponentTasks];
[manager createFinish];

page->CallBridgeTime(getCurrentTime() - startTime);
if (page) {
page->CallBridgeTime(getCurrentTime() - startTime);
}
return 0;
}

int IOSSide::RenderSuccess(const char* pageId)
{
RenderPageBase *page = RenderManager::GetInstance()->GetPage(pageId);
if (page == nullptr) {
return -1;
}

long long startTime = getCurrentTime();

Expand All @@ -802,7 +798,9 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
[manager startComponentTasks];
[manager renderFinish];

page->CallBridgeTime(getCurrentTime() - startTime);
if (page) {
page->CallBridgeTime(getCurrentTime() - startTime);
}
return 0;
}

Expand Down Expand Up @@ -1261,10 +1259,12 @@ - (void)callRemoveEvent:(NSString*)pageId ref:(NSString*)ref event:(NSString*)ev

- (void)callCreateFinish:(NSString*)pageId
{
RenderPageCustom* page = [self getPage:pageId];
if (page && page->IsValid()) {
page->CreateFinish();
}
WXPerformBlockOnComponentThread(^{
RenderPageCustom* page = [self getPage:pageId];
if (page && page->IsValid()) {
page->CreateFinish();
}
});
}

- (void)callRefreshFinish:(NSString*)pageId
Expand Down
11 changes: 8 additions & 3 deletions ios/sdk/WeexSDK/Sources/Module/WXDomModule.m
Expand Up @@ -155,9 +155,14 @@ - (void)removeEvent:(NSString *)ref event:(NSString *)event
- (void)createFinish
{
NSString* instanceId = self.weexInstance.instanceId;
WXPerformBlockOnComponentThread(^{
[WXCoreBridge callCreateFinish:instanceId];
});
if ([WXCustomPageBridge isCustomPage:instanceId]) {
[[WXCustomPageBridge sharedInstance] callCreateFinish:instanceId];
}
else {
WXPerformBlockOnComponentThread(^{
[WXCoreBridge callCreateFinish:instanceId];
});
}
}

- (void)updateFinish
Expand Down

0 comments on commit a0aae4f

Please sign in to comment.