Skip to content

Commit 1d23140

Browse files
author
Ives van Hoorne
committed
Depend initial open on root
1 parent 55d414f commit 1d23140

File tree

1 file changed

+11
-5
lines changed
  • src/app/pages/SandboxView/Sandbox/Editor/Workspace/Files/DirectoryEntry

1 file changed

+11
-5
lines changed

src/app/pages/SandboxView/Sandbox/Editor/Workspace/Files/DirectoryEntry/index.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,16 @@ type State = {
6464
};
6565
class DirectoryEntry extends React.PureComponent {
6666
props: Props;
67-
state: State = {
68-
creating: '',
69-
open: false,
70-
};
67+
state: State;
68+
69+
constructor(props) {
70+
super(props);
71+
72+
this.state = {
73+
creating: '',
74+
open: props.root,
75+
};
76+
}
7177

7278
resetState = () => this.setState({ creating: '' });
7379

@@ -207,7 +213,7 @@ class DirectoryEntry extends React.PureComponent {
207213
closeTree={this.closeTree}
208214
/>
209215
</EntryContainer>
210-
<Opener open={root || open}>
216+
<Opener open={open}>
211217
{creating === 'directory' &&
212218
<Entry
213219
id=""

0 commit comments

Comments
 (0)