Skip to content

Commit

Permalink
catch Okay window count from FirstRun
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJoeFin committed Mar 4, 2024
1 parent 62945f6 commit fd158a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Text-Grab/Views/FirstRunWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using Text_Grab.Properties;
using Text_Grab.Utilities;
Expand Down Expand Up @@ -110,7 +109,9 @@ private void NotificationsCheckBox_Checked(object sender, RoutedEventArgs e)

private void OkayButton_Click(object sender, RoutedEventArgs e)
{
if (System.Windows.Application.Current.Windows.Count == 1)
int windowsCount = Application.Current.Windows.Count;

if (windowsCount == 2 || windowsCount == 1)
{
TextGrabMode defaultLaunchSetting = Enum.Parse<TextGrabMode>(Settings.Default.DefaultLaunch, true);
switch (defaultLaunchSetting)
Expand All @@ -132,7 +133,7 @@ private void OkayButton_Click(object sender, RoutedEventArgs e)
}
}

this.Close();
Close();
}
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
Expand Down

0 comments on commit fd158a5

Please sign in to comment.