Skip to content

Commit fd158a5

Browse files
committed
catch Okay window count from FirstRun
1 parent 62945f6 commit fd158a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Text-Grab/Views/FirstRunWindow.xaml.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Diagnostics;
33
using System.Windows;
4-
using System.Windows.Controls;
54
using System.Windows.Media;
65
using Text_Grab.Properties;
76
using Text_Grab.Utilities;
@@ -110,7 +109,9 @@ private void NotificationsCheckBox_Checked(object sender, RoutedEventArgs e)
110109

111110
private void OkayButton_Click(object sender, RoutedEventArgs e)
112111
{
113-
if (System.Windows.Application.Current.Windows.Count == 1)
112+
int windowsCount = Application.Current.Windows.Count;
113+
114+
if (windowsCount == 2 || windowsCount == 1)
114115
{
115116
TextGrabMode defaultLaunchSetting = Enum.Parse<TextGrabMode>(Settings.Default.DefaultLaunch, true);
116117
switch (defaultLaunchSetting)
@@ -132,7 +133,7 @@ private void OkayButton_Click(object sender, RoutedEventArgs e)
132133
}
133134
}
134135

135-
this.Close();
136+
Close();
136137
}
137138
private void RadioButton_Checked(object sender, RoutedEventArgs e)
138139
{

0 commit comments

Comments
 (0)