Skip to content

Commit

Permalink
Better tray error
Browse files Browse the repository at this point in the history
  • Loading branch information
TCNOco committed Jun 9, 2021
1 parent 140c43f commit e077ee1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion TcNo-Acc-Switcher-Tray/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ public AppCont()

private void InitMenu(bool first = true)
{
if (!File.Exists("Tray_Users.json")) Environment.Exit(1);
MessageBox.Show(
$"There were no accounts found.{Environment.NewLine}Try switching accounts first, or locate 'Tray_Users.json'",
"Tray Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (!File.Exists("Tray_Users.json"))
{
MessageBox.Show(
"There were no accounts found. Try switching accounts first, or locate 'Tray_Users.json'",
"Tray Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(1);
}
if (string.Equals(Program.LastHash, GetFileMd5("Tray_Users.json"), StringComparison.Ordinal)) return; // Don't init again
Program.LastHash = GetFileMd5("Tray_Users.json");

Expand Down

0 comments on commit e077ee1

Please sign in to comment.