This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class ChangesView : Subview
28
28
[ SerializeField ] private Vector2 scroll ;
29
29
[ SerializeField ] private CacheUpdateEvent lastCurrentBranchChangedEvent ;
30
30
[ SerializeField ] private CacheUpdateEvent lastStatusChangedEvent ;
31
- [ SerializeField ] private Tree treeChanges = new Tree ( ) ;
31
+ [ SerializeField ] private Tree treeChanges ;
32
32
[ SerializeField ] private List < GitStatusEntry > gitStatusEntries ;
33
33
34
34
public override void OnEnable ( )
@@ -188,10 +188,13 @@ private void MaybeUpdateData()
188
188
189
189
private void BuildTree ( )
190
190
{
191
- treeChanges = new Tree ( ) ;
192
- treeChanges . ActiveNodeIcon = Styles . ActiveBranchIcon ;
193
- treeChanges . NodeIcon = Styles . BranchIcon ;
194
- treeChanges . FolderIcon = Styles . FolderIcon ;
191
+ if ( treeChanges == null )
192
+ {
193
+ treeChanges = new Tree ( ) ;
194
+ treeChanges . ActiveNodeIcon = Styles . ActiveBranchIcon ;
195
+ treeChanges . NodeIcon = Styles . BranchIcon ;
196
+ treeChanges . FolderIcon = Styles . FolderIcon ;
197
+ }
195
198
196
199
treeChanges . Load ( gitStatusEntries . Select ( entry => new GitStatusEntryTreeData ( entry ) ) . Cast < ITreeData > ( ) , "Changes" ) ;
197
200
Redraw ( ) ;
You can’t perform that action at this time.
0 commit comments