feat: context's source ignore what behinds semicolon
This commit is contained in:
parent
e822797166
commit
6bc9c7629a
@ -240,7 +240,12 @@ public class DoricDev {
|
|||||||
List<DoricContext> list = new ArrayList<>();
|
List<DoricContext> list = new ArrayList<>();
|
||||||
source = source.replace(".js", "").replace(".ts", "");
|
source = source.replace(".js", "").replace(".ts", "");
|
||||||
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
for (DoricContext context : DoricContextManager.aliveContexts()) {
|
||||||
String doricSource = context.getSource().replace(".js", "").replace(".ts", "");
|
String doricSource = context.getSource();
|
||||||
|
String[] split = doricSource.split(";");
|
||||||
|
if (split.length > 1) {
|
||||||
|
doricSource = split[0];
|
||||||
|
}
|
||||||
|
doricSource = doricSource.replace(".js", "").replace(".ts", "");
|
||||||
if (source.equals(doricSource) || doricSource.equals("__dev__")) {
|
if (source.equals(doricSource) || doricSource.equals("__dev__")) {
|
||||||
list.add(context);
|
list.add(context);
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,12 @@ - (BOOL)isReloadingContext:(DoricContext *)context {
|
|||||||
withString:@""
|
withString:@""
|
||||||
];
|
];
|
||||||
for (DoricContext *context in [DoricContextManager.instance aliveContexts]) {
|
for (DoricContext *context in [DoricContextManager.instance aliveContexts]) {
|
||||||
NSString *contextSource = [[context.source stringByReplacingOccurrencesOfString:@".js"
|
NSString *contextSource = context.source;
|
||||||
|
NSArray<NSString *> *split = [contextSource componentsSeparatedByString:@";"];
|
||||||
|
if (split.count > 1) {
|
||||||
|
contextSource = split[0];
|
||||||
|
}
|
||||||
|
contextSource = [[contextSource stringByReplacingOccurrencesOfString:@".js"
|
||||||
withString:@""]
|
withString:@""]
|
||||||
stringByReplacingOccurrencesOfString:@".ts"
|
stringByReplacingOccurrencesOfString:@".ts"
|
||||||
withString:@""
|
withString:@""
|
||||||
@ -288,7 +293,7 @@ - (NSString *)ip {
|
|||||||
// Return presented view controller
|
// Return presented view controller
|
||||||
return findBestViewController(vc.presentedViewController);
|
return findBestViewController(vc.presentedViewController);
|
||||||
} else if ([vc isKindOfClass:[UISplitViewController class]]) {
|
} else if ([vc isKindOfClass:[UISplitViewController class]]) {
|
||||||
// Return right hand side
|
// Return right-hand side
|
||||||
UISplitViewController *svc = (UISplitViewController *) vc;
|
UISplitViewController *svc = (UISplitViewController *) vc;
|
||||||
if (svc.viewControllers.count > 0)
|
if (svc.viewControllers.count > 0)
|
||||||
return findBestViewController(svc.viewControllers.lastObject);
|
return findBestViewController(svc.viewControllers.lastObject);
|
||||||
|
Reference in New Issue
Block a user