Skip to content

Commit

Permalink
Adding logging actually caused the exception to not occur? Race condi…
Browse files Browse the repository at this point in the history
…tion? Anyawys, seems to work now with a catch too so I guess I take it
  • Loading branch information
Inzaniity committed May 15, 2024
1 parent aa39dc2 commit 1fe64c1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions Songify Slim/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,23 @@ private void SetupDisclaimer()

private async Task FinalSetupAndUpdatesAsync()
{
await SendTelemetry();
Settings.IsLive = await TwitchHandler.CheckStreamIsUp();
SetFetchTimer();

try
{
Logger.LogStr("Starting final setup and updates");
Logger.LogStr("Sending Telemetry");
await SendTelemetry();
Logger.LogStr("Telemetry sent");
Logger.LogStr("Check Stream up");
Settings.IsLive = await TwitchHandler.CheckStreamIsUp();
Logger.LogStr("Check Stream up done");
Logger.LogStr("SetFetchTimer");
SetFetchTimer();
Logger.LogStr("SetFetchTimer done");
}
catch (Exception e)
{
Logger.LogExc(e);
}
if (Settings.UpdateRequired)
{
List<int> userLevels = [];
Expand Down Expand Up @@ -671,8 +684,7 @@ private static void CheckForUpdates()

private void CreateSystrayIcon()
{
_contextMenu.MenuItems.AddRange(new[]
{
_contextMenu.MenuItems.AddRange([
new System.Windows.Forms.MenuItem("Twitch", [
new System.Windows.Forms.MenuItem("Connect", (_, _) =>
{
Expand All @@ -694,7 +706,7 @@ private void CreateSystrayIcon()
_forceClose = true;
Close();
})
});
]);
NotifyIcon.Icon = Properties.Resources.songify;
NotifyIcon.ContextMenu = _contextMenu;
NotifyIcon.Visible = true;
Expand Down

0 comments on commit 1fe64c1

Please sign in to comment.