Skip to content

Commit

Permalink
Added cleanup of subscription. Cleaned up comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Jul 24, 2018
1 parent 948d87a commit 6628c55
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/app/client/src/ui/editor/emulator/parts/log/log.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ export default class Log extends React.Component<LogProps, LogState> {
}
}

componentWillUnmount(): void {
// clean up activity subscription
if (this.selectedActivitySubscription) {
this.selectedActivitySubscription.unsubscribe();
}
}

render() {
let key = 0;
return (
Expand All @@ -157,7 +164,7 @@ export interface LogEntryProps {
}

class LogEntryComponent extends React.Component<LogEntryProps> {
/** Allows <LogEntry />'s to highlight themselves based on their <LogItem /> children */
/** Allows <LogEntry />'s to highlight themselves based on their log item children */
private inspectableObjects: { [id: string]: boolean };

/** Sends obj to the inspector panel
Expand Down Expand Up @@ -212,7 +219,7 @@ class LogEntryComponent extends React.Component<LogEntryProps> {
this.inspectableObjects = {};

// render the timestamp and any items to be displayed within the entry;
// any rendered inspectable items will add themselves to the inspectable objects lookup
// any rendered inspectable items will add themselves to this.inspectableObjects
const innerJsx = (
<>
{ this.renderTimestamp(this.props.entry.timestamp) }
Expand All @@ -221,7 +228,7 @@ class LogEntryComponent extends React.Component<LogEntryProps> {
);

// if the currently selected activity matches any of this item's inner inspectable
// objects, append an 'inspected' classname to the log entry to highlight it
// objects, append an 'inspected' class name to the log entry to highlight it
const { currentlyInspectedActivity } = this.props;
let inspectedActivityClass = '';
if (currentlyInspectedActivity && currentlyInspectedActivity.id) {
Expand Down

0 comments on commit 6628c55

Please sign in to comment.