Fixed bug with flipper live editing

Summary:
Fixed bug with live editing
Previously if the meaining of the value was changed in flipper you receive back same value as it was
Now you see correct changed value

Reviewed By: priteshrnandgaonkar

Differential Revision: D16162141

fbshipit-source-id: 1a68ea64603171e952382c5093470d2cc12f7bbe
This commit is contained in:
Roman Gorbunov
2019-07-10 06:59:45 -07:00
committed by Facebook Github Bot
parent 169836fc2f
commit cf1347d2e3

View File

@@ -161,6 +161,19 @@
[responder success:@{@"allNodes": @{@"rootElement": identifier, @"elements": allNodesDict}}];
}
- (NSMutableArray*)getChildrenForNode:(id)node withDescriptor:(SKNodeDescriptor*)descriptor {
NSMutableArray *children = [NSMutableArray new];
for (NSUInteger i = 0; i < [descriptor childCountForNode: node]; i++) {
id childNode = [descriptor childForNode: node atIndex: i];
NSString *childIdentifier = [self trackObject: childNode];
if (childIdentifier) {
[children addObject: childIdentifier];
}
}
return children;
}
- (void)onCallGetNodes:(NSArray<NSDictionary *> *)nodeIds withResponder:(id<FlipperResponder>)responder {
NSMutableArray<NSDictionary *> *elements = [NSMutableArray new];
@@ -201,7 +214,11 @@
SKNodeUpdateData updateDataForPath = [[descriptor dataMutationsForNode: node] objectForKey: dotJoinedPath];
if (updateDataForPath != nil) {
updateDataForPath(value);
[connection send: @"invalidate" withParams: @{ @"id": [descriptor identifierForNode: node] }];
NSMutableArray *children = [self getChildrenForNode:node withDescriptor:descriptor];
[connection send: @"invalidate" withParams: @{
@"nodes": @[@{@"id": [descriptor identifierForNode: node], @"children": children}]
}];
}
}
@@ -405,15 +422,7 @@
data[namedPair.name] = namedPair.value;
}
NSMutableArray *children = [NSMutableArray new];
for (NSUInteger i = 0; i < [nodeDescriptor childCountForNode: node]; i++) {
id childNode = [nodeDescriptor childForNode: node atIndex: i];
NSString *childIdentifier = [self trackObject: childNode];
if (childIdentifier) {
[children addObject: childIdentifier];
}
}
NSMutableArray *children = [self getChildrenForNode: node withDescriptor:nodeDescriptor];
NSDictionary *nodeDic =
@{