@@ -32,7 +32,6 @@ import actions from "../../actions";
32
32
import AccessibleImage from "../shared/AccessibleImage" ;
33
33
import SourcesTreeItem from "./SourcesTreeItem" ;
34
34
import ManagedTree from "../shared/ManagedTree" ;
35
- import Svg from "../shared/Svg" ;
36
35
37
36
// Utils
38
37
import {
@@ -69,7 +68,6 @@ type Props = {
69
68
expanded : Set < string > ,
70
69
selectSource : typeof actions . selectSource ,
71
70
setExpandedState : typeof actions . setExpandedState ,
72
- clearProjectDirectoryRoot : typeof actions . clearProjectDirectoryRoot ,
73
71
focusItem : typeof actions . focusItem ,
74
72
focused : TreeNode ,
75
73
workerCount : number
@@ -215,30 +213,6 @@ class SourcesTree extends Component<Props, State> {
215
213
) ;
216
214
}
217
215
218
- renderProjectRootHeader ( ) {
219
- const { projectRoot } = this . props ;
220
-
221
- if ( ! projectRoot ) {
222
- return null ;
223
- }
224
-
225
- const rootLabel = projectRoot . split ( "/" ) . pop ( ) ;
226
-
227
- return (
228
- < div key = "root" className = "sources-clear-root-container" >
229
- < button
230
- className = "sources-clear-root"
231
- onClick = { ( ) => this . props . clearProjectDirectoryRoot ( ) }
232
- title = { L10N . getStr ( "removeDirectoryRoot.label" ) }
233
- >
234
- < Svg name = "home" />
235
- < Svg name = "breadcrumb" />
236
- < span className = "sources-clear-root-label" > { rootLabel } </ span >
237
- </ button >
238
- </ div >
239
- ) ;
240
- }
241
-
242
216
getRoots = ( ) => {
243
217
const { projectRoot } = this . props ;
244
218
const { sourceTree } = this . state ;
@@ -248,7 +222,7 @@ class SourcesTree extends Component<Props, State> {
248
222
249
223
// The "sourceTree.contents[0]" check ensures that there are contents
250
224
// A custom root with no existing sources will be ignored
251
- if ( projectRoot ) {
225
+ if ( projectRoot && sourceContents ) {
252
226
if ( sourceContents && sourceContents . name !== rootLabel ) {
253
227
return sourceContents . contents [ 0 ] . contents ;
254
228
}
@@ -350,28 +324,14 @@ class SourcesTree extends Component<Props, State> {
350
324
}
351
325
352
326
render ( ) {
353
- const { projectRoot , worker } = this . props ;
327
+ const { worker } = this . props ;
354
328
355
329
if ( ! features . windowlessWorkers && worker ) {
356
330
return null ;
357
331
}
358
332
359
- if ( this . isEmpty ( ) ) {
360
- if ( projectRoot ) {
361
- return this . renderPane (
362
- this . renderProjectRootHeader ( ) ,
363
- this . renderEmptyElement ( L10N . getStr ( "sources.noSourcesAvailableRoot" ) )
364
- ) ;
365
- }
366
-
367
- return this . renderPane (
368
- this . renderEmptyElement ( L10N . getStr ( "sources.noSourcesAvailable" ) )
369
- ) ;
370
- }
371
-
372
333
return this . renderPane (
373
334
this . renderThreadHeader ( ) ,
374
- this . renderProjectRootHeader ( ) ,
375
335
< div key = "tree" className = "sources-list" onKeyDown = { this . onKeyDown } >
376
336
{ this . renderTree ( ) }
377
337
</ div >
@@ -420,7 +380,6 @@ export default connect(
420
380
{
421
381
selectSource : actions . selectSource ,
422
382
setExpandedState : actions . setExpandedState ,
423
- clearProjectDirectoryRoot : actions . clearProjectDirectoryRoot ,
424
383
focusItem : actions . focusItem
425
384
}
426
385
) ( SourcesTree ) ;
0 commit comments