feat:reload match context adjust
This commit is contained in:
parent
39fbd296de
commit
d834f03835
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user