iOS:optimize devkit header ui
This commit is contained in:
@@ -45,7 +45,6 @@ - (instancetype)initWithUrl:(NSString *)url {
|
||||
|
||||
- (void)webSocketDidOpen:(SRWebSocket *)webSocket {
|
||||
DoricLog(@"webSocketDidOpen");
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"OpenEvent" object:nil];
|
||||
[DoricDev.instance onOpen];
|
||||
}
|
||||
|
||||
@@ -83,18 +82,6 @@ - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message {
|
||||
NSString *script = payload[@"script"];
|
||||
[DoricDev.instance reload:source script:script];
|
||||
}
|
||||
|
||||
if ([cmd compare:@"SWITCH_TO_DEBUG"] == NSOrderedSame) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"EnterDebugEvent" object:nil];
|
||||
} else if ([cmd compare:@"RELOAD"] == NSOrderedSame) {
|
||||
NSString *source = [[dic valueForKey:@"source"] mutableCopy];
|
||||
NSString *script = [dic valueForKey:@"script"];
|
||||
for (DoricContext *context in [[DoricContextManager instance] aliveContexts]) {
|
||||
if ([source containsString:context.source] || [context.source isEqualToString:@"__dev__"]) {
|
||||
[context reload:script];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error {
|
||||
@@ -138,5 +125,6 @@ - (void)sendToServer:(NSString *)cmd payload:(NSDictionary *)payload {
|
||||
|
||||
- (void)close {
|
||||
[self.websocket close];
|
||||
[DoricDev.instance onClose];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user