diff --git a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java index 7c6e152b..576658f4 100644 --- a/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java +++ b/doric-android/devkit/src/main/java/pub/doric/devkit/DoricDev.java @@ -206,8 +206,10 @@ public class DoricDev { } public DoricContext matchContext(String source) { + source = source.replace(".js", "").replace(".ts", ""); for (DoricContext context : DoricContextManager.aliveContexts()) { - if (source.contains(context.getSource()) || context.getSource().equals("__dev__")) { + String doricSource = context.getSource().replace(".js", "").replace(".ts", ""); + if (source.equals(doricSource) || doricSource.equals("__dev__")) { return context; } } diff --git a/doric-iOS/Devkit/Classes/DoricDev.m b/doric-iOS/Devkit/Classes/DoricDev.m index 39de1a85..fcf85765 100644 --- a/doric-iOS/Devkit/Classes/DoricDev.m +++ b/doric-iOS/Devkit/Classes/DoricDev.m @@ -154,8 +154,18 @@ - (BOOL)isReloadingContext:(DoricContext *)context { - (DoricContext *)matchContext:(NSString *)source { + source = [[source stringByReplacingOccurrencesOfString:@".js" + withString:@""] + stringByReplacingOccurrencesOfString:@".ts" + withString:@"" + ]; for (DoricContext *context in [DoricContextManager.instance aliveContexts]) { - if ([source containsString:context.source] || [context.source isEqualToString:@"__dev__"]) { + NSString *contextSource = [[context.source stringByReplacingOccurrencesOfString:@".js" + withString:@""] + stringByReplacingOccurrencesOfString:@".ts" + withString:@"" + ]; + if ([source isEqualToString:contextSource] || [contextSource isEqualToString:@"__dev__"]) { return context; } }