feat:fix Register DevMonitor

This commit is contained in:
pengfeizhou
2021-02-07 15:58:11 +08:00
committed by osborn
parent cf4d0498b9
commit 8f0486329e
2 changed files with 3 additions and 25 deletions

View File

@@ -30,15 +30,6 @@
#import "DoricDevViewController.h"
#import "DoricDevMonitor.h"
@interface DoricDevLibrary : DoricLibrary
@end
@implementation DoricDevLibrary
- (void)load:(DoricRegistry *)registry {
}
@end
@interface DoricDev ()
@property(nonatomic, strong) DoricWSClient *wsclient;
@property(nonatomic, strong) DoricContext *context;
@@ -56,12 +47,7 @@ - (instancetype)init {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onEnterDebugEvent) name:@"EnterDebugEvent" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onStopDebugEvent) name:@"StopDebugEvent" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onDebuggerReadyEvent) name:@"DebuggerReadyEvent" object:nil];
[Doric registerLibrary:[DoricDevLibrary new]];
NSValue *value = DoricContextManager.instance.aliveContexts.firstObject;
if (value) {
DoricContext *context = value.nonretainedObjectValue;
[context.driver.registry registerMonitor:[DoricDevMonitor new]];
}
[DoricNativeDriver.instance.registry registerMonitor:[DoricDevMonitor new]];
}
return self;
}