Skip to content

Commit

Permalink
Don't make the app start slower
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Oct 29, 2022
1 parent 8ce1f1c commit 7a98875
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/LudusaviPlaynite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,26 +318,29 @@ public override void OnApplicationStarted(OnApplicationStartedEventArgs args)
SavePluginSettings(settings);
}

RefreshLudusaviVersion();
RefreshLudusaviBackups();

if (appVersion.version < RECOMMENDED_APP_VERSION && new Version(settings.SuggestedUpgradeTo) < RECOMMENDED_APP_VERSION)
Task.Run(() =>
{
NotifyInfo(
translator.UpgradePrompt(RECOMMENDED_APP_VERSION.ToString()),
() =>
{
try
RefreshLudusaviVersion();
RefreshLudusaviBackups();
if (appVersion.version < RECOMMENDED_APP_VERSION && new Version(settings.SuggestedUpgradeTo) < RECOMMENDED_APP_VERSION)
{
NotifyInfo(
translator.UpgradePrompt(RECOMMENDED_APP_VERSION.ToString()),
() =>
{
RunCommand("cmd.exe", "/c \"start https://github.com/mtkennerly/ludusavi/releases\"");
try
{
RunCommand("cmd.exe", "/c \"start https://github.com/mtkennerly/ludusavi/releases\"");
}
catch
{ }
}
catch
{ }
}
);
settings.SuggestedUpgradeTo = RECOMMENDED_APP_VERSION.ToString();
SavePluginSettings(settings);
}
);
settings.SuggestedUpgradeTo = RECOMMENDED_APP_VERSION.ToString();
SavePluginSettings(settings);
}
});
}

public override void OnGameStarting(OnGameStartingEventArgs args)
Expand Down

0 comments on commit 7a98875

Please sign in to comment.