Skip to content

Commit

Permalink
Add "empty" log type for children of structured data
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Sep 6, 2023
1 parent 80b7ff5 commit 9851360
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shared/log/Log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export default class Log {
Object.entries(decodedData.schemaTypes).forEach(([childKey, schemaType]) => {
// Create the key so it can be dragged even though it doesn't have data
let fullChildKey = key + "/" + childKey;
this.createBlankField(fullChildKey, LoggableType.Raw);
this.createBlankField(fullChildKey, LoggableType.Empty);
this.processTimestamp(fullChildKey, timestamp);
this.fields[fullChildKey].specialType = schemaType;
});
Expand Down
2 changes: 2 additions & 0 deletions src/shared/log/LogUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export function logValuesEqual(type: LoggableType, a: any, b: any): boolean {
return arraysEqual(a, b);
case LoggableType.Raw:
return arraysEqual(Array.from(a as Uint8Array), Array.from(b as Uint8Array));
default:
return false;
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/shared/log/LoggableType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ enum LoggableType {
String,
BooleanArray,
NumberArray,
StringArray
StringArray,
Empty // Used as a placeholder for child fields of structured data
}

export default LoggableType;

0 comments on commit 9851360

Please sign in to comment.