From 5a440e30f41f18cfbc4ef84ca463a0c42463cdad Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Fri, 29 Nov 2019 11:45:39 +0800 Subject: [PATCH] feat:fix when reloading wont work --- Android/doric/src/main/java/pub/doric/DoricContext.java | 1 + iOS/Pod/Classes/DoricContext.m | 1 + 2 files changed, 2 insertions(+) diff --git a/Android/doric/src/main/java/pub/doric/DoricContext.java b/Android/doric/src/main/java/pub/doric/DoricContext.java index ab791f14..09d7b0d2 100644 --- a/Android/doric/src/main/java/pub/doric/DoricContext.java +++ b/Android/doric/src/main/java/pub/doric/DoricContext.java @@ -161,6 +161,7 @@ public class DoricContext { public void reload(String script) { this.script = script; + this.mRootNode.setId(""); getDriver().createContext(mContextId, script, source); callEntity(DoricConstant.DORIC_ENTITY_INIT, this.initParams); } diff --git a/iOS/Pod/Classes/DoricContext.m b/iOS/Pod/Classes/DoricContext.m index 09e946b6..d675a141 100644 --- a/iOS/Pod/Classes/DoricContext.m +++ b/iOS/Pod/Classes/DoricContext.m @@ -82,6 +82,7 @@ - (void)initContextWithWidth:(CGFloat)width height:(CGFloat)height { } - (void)reload:(NSString *)script { + self.rootNode.viewId = nil; self.script = script; [self.driver createContext:self.contextId script:script source:self.source]; [self callEntity:DORIC_ENTITY_INIT, self.initialParams, nil];