From b169f581d30f528ff3af9dbcceeee2fc410bab97 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Thu, 30 Apr 2020 17:58:35 +0800 Subject: [PATCH] feat:protect when build set navbar's view --- .../doric/src/main/java/pub/doric/plugin/ShaderPlugin.java | 2 +- doric-iOS/Pod/Classes/Plugin/DoricShaderPlugin.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java index 9751ff90..f216080c 100644 --- a/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java +++ b/doric-android/doric/src/main/java/pub/doric/plugin/ShaderPlugin.java @@ -65,7 +65,7 @@ public class ShaderPlugin extends DoricJavaPlugin { } String viewId = jsObject.getProperty("id").asString().value(); RootNode rootNode = getDoricContext().getRootNode(); - if (TextUtils.isEmpty(rootNode.getId())) { + if (TextUtils.isEmpty(rootNode.getId()) && "Root".equals(jsObject.getProperty("type").asString().value())) { rootNode.setId(viewId); rootNode.blend(jsObject.getProperty("props").asObject()); } else { diff --git a/doric-iOS/Pod/Classes/Plugin/DoricShaderPlugin.m b/doric-iOS/Pod/Classes/Plugin/DoricShaderPlugin.m index 3c45fd68..0ccc3b93 100644 --- a/doric-iOS/Pod/Classes/Plugin/DoricShaderPlugin.m +++ b/doric-iOS/Pod/Classes/Plugin/DoricShaderPlugin.m @@ -38,7 +38,7 @@ - (void)render:(NSDictionary *)argument withPromise:(DoricPromise *)promise { NSString *viewId = argument[@"id"]; - if (self.doricContext.rootNode.viewId == nil) { + if (self.doricContext.rootNode.viewId == nil && [@"Root" isEqualToString:argument[@"type"]]) { self.doricContext.rootNode.viewId = viewId; [self.doricContext.rootNode blend:argument[@"props"]]; [self.doricContext.rootNode requestLayout];