@@ -25,8 +25,7 @@ class Window : BaseWindow
2525 private const string Window_RepoBranchTooltip = "Active branch" ;
2626
2727 [ NonSerialized ] private double notificationClearTime = - 1 ;
28- [ SerializeField ] private SubTab ? nextTab ;
29-
28+ [ SerializeField ] private SubTab nextTab = SubTab . History ;
3029 [ SerializeField ] private SubTab activeTab = SubTab . History ;
3130 [ SerializeField ] private InitProjectView initProjectView = new InitProjectView ( ) ;
3231 [ SerializeField ] private BranchesView branchesView = new BranchesView ( ) ;
@@ -162,10 +161,10 @@ public override void OnUI()
162161
163162 DoToolbarGUI ( ) ;
164163
165- if ( nextTab . HasValue )
164+ if ( nextTab != activeTab )
166165 {
167- SetActiveTab ( nextTab . Value ) ;
168- nextTab = null ;
166+ SetActiveTab ( nextTab ) ;
167+ nextTab = activeTab ;
169168 }
170169
171170 // GUI for the active tab
@@ -201,7 +200,7 @@ private bool MaybeUpdateData(out string repoRemote)
201200 {
202201 if ( activeTab == SubTab . InitProject )
203202 {
204- if ( ! nextTab . HasValue || nextTab . Value == SubTab . InitProject )
203+ if ( nextTab == SubTab . InitProject )
205204 {
206205 nextTab = SubTab . History ;
207206 repoDataChanged = true ;
@@ -229,7 +228,7 @@ private bool MaybeUpdateData(out string repoRemote)
229228 {
230229 if ( ! ( activeTab == SubTab . InitProject || activeTab == SubTab . Settings ) )
231230 {
232- if ( ! nextTab . HasValue || nextTab . Value != SubTab . InitProject )
231+ if ( ! ( nextTab == SubTab . InitProject || activeTab == SubTab . Settings ) )
233232 {
234233 nextTab = SubTab . InitProject ;
235234 repoDataChanged = true ;
0 commit comments