iOS:optimize devkit header ui

This commit is contained in:
pengfeizhou
2021-02-24 16:51:23 +08:00
committed by osborn
parent efdabd8309
commit dfcbec696e
4 changed files with 178 additions and 30 deletions

View File

@@ -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