@@ -42,6 +42,8 @@ import {
42
42
getExtension
43
43
} from "../../utils/sources-tree" ;
44
44
45
+ import { getRawSourceURL } from "../../utils/source" ;
46
+
45
47
import { copyToTheClipboard } from "../../utils/clipboard" ;
46
48
import { features } from "../../utils/prefs" ;
47
49
@@ -92,13 +94,7 @@ class SourcesTree extends Component<Props, State> {
92
94
}
93
95
94
96
componentWillReceiveProps ( nextProps ) {
95
- const {
96
- projectRoot ,
97
- debuggeeUrl ,
98
- sources ,
99
- shownSource ,
100
- selectedSource
101
- } = this . props ;
97
+ const { projectRoot , debuggeeUrl , sources , shownSource } = this . props ;
102
98
103
99
const { uncollapsedTree, sourceTree } = this . state ;
104
100
@@ -127,16 +123,16 @@ class SourcesTree extends Component<Props, State> {
127
123
return this . setState ( { listItems } ) ;
128
124
}
129
125
130
- if (
131
- nextProps . selectedSource &&
132
- nextProps . selectedSource != selectedSource
133
- ) {
134
- const highlightItems = getDirectories (
135
- nextProps . selectedSource . get ( "url" ) ,
136
- sourceTree
137
- ) ;
126
+ if ( nextProps . selectedSource ) {
127
+ const highlightUrl = nextProps . selectedSource . get ( "url" ) ;
138
128
139
- return this . setState ( { highlightItems } ) ;
129
+ if ( highlightUrl ) {
130
+ const highlightItems = getDirectories (
131
+ getRawSourceURL ( highlightUrl ) ,
132
+ sourceTree
133
+ ) ;
134
+ return this . setState ( { highlightItems } ) ;
135
+ }
140
136
}
141
137
142
138
// NOTE: do not run this every time a source is clicked,
0 commit comments