Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 95deeea

Browse files
darkwingjasonLaster
authored andcommitted
Revert "Ensure the source tree highlights the correct item, regardless of pretty or original print (#5455)" (#5507)
This reverts commit 4fc2923.
1 parent e98a98c commit 95deeea

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/components/PrimaryPanes/SourcesTree.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ import {
4242
getExtension
4343
} from "../../utils/sources-tree";
4444

45-
import { getRawSourceURL } from "../../utils/source";
46-
4745
import { copyToTheClipboard } from "../../utils/clipboard";
4846
import { features } from "../../utils/prefs";
4947

@@ -94,7 +92,13 @@ class SourcesTree extends Component<Props, State> {
9492
}
9593

9694
componentWillReceiveProps(nextProps) {
97-
const { projectRoot, debuggeeUrl, sources, shownSource } = this.props;
95+
const {
96+
projectRoot,
97+
debuggeeUrl,
98+
sources,
99+
shownSource,
100+
selectedSource
101+
} = this.props;
98102

99103
const { uncollapsedTree, sourceTree } = this.state;
100104

@@ -123,16 +127,16 @@ class SourcesTree extends Component<Props, State> {
123127
return this.setState({ listItems });
124128
}
125129

126-
if (nextProps.selectedSource) {
127-
const highlightUrl = nextProps.selectedSource.get("url");
130+
if (
131+
nextProps.selectedSource &&
132+
nextProps.selectedSource != selectedSource
133+
) {
134+
const highlightItems = getDirectories(
135+
nextProps.selectedSource.get("url"),
136+
sourceTree
137+
);
128138

129-
if (highlightUrl) {
130-
const highlightItems = getDirectories(
131-
getRawSourceURL(highlightUrl),
132-
sourceTree
133-
);
134-
return this.setState({ highlightItems });
135-
}
139+
return this.setState({ highlightItems });
136140
}
137141

138142
// NOTE: do not run this every time a source is clicked,

0 commit comments

Comments
 (0)