Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f9bd4fc

Browse files
Making nextTab not nullable
1 parent 62bc3b6 commit f9bd4fc

File tree

1 file changed

+6
-7
lines changed
  • src/UnityExtension/Assets/Editor/GitHub.Unity/UI

1 file changed

+6
-7
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/Window.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)