Skip to content

Commit

Permalink
Merge pull request #69 from #68-aircraft-type-crash
Browse files Browse the repository at this point in the history
Agent#68 aircraft type crash
  • Loading branch information
sushiat authored Nov 23, 2023
2 parents 7759a9a + 44938a6 commit 9c621d1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
8 changes: 7 additions & 1 deletion OpenSky.Agent/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,15 @@ private static void AppDispatcherUnhandledException(

try
{
var openSkyFolder = Environment.ExpandEnvironmentVariables("%localappdata%\\OpenSky");
if (!Directory.Exists(openSkyFolder))
{
Directory.CreateDirectory(openSkyFolder);
}

File.AppendAllText(filePath, crashReport);
ModernWpf.MessageBox.Show(
e.Exception.Message + "\r\n\r\nPlease check agent_crash.log for details!",
$"{e.Exception.Message}\r\n\r\nPlease check {filePath} for details!",
"Unexpected error!",
MessageBoxButton.OK,
MessageBoxImage.Error);
Expand Down
4 changes: 2 additions & 2 deletions OpenSky.Agent/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("0.5.0")]
[assembly: AssemblyFileVersion("0.5.0")]
[assembly: AssemblyVersion("0.5.1")]
[assembly: AssemblyFileVersion("0.5.1")]

// This allows us to detect debug mode in XAML
#if DEBUG
Expand Down
7 changes: 5 additions & 2 deletions OpenSky.Agent/Views/Models/AircraftTypesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1906,8 +1906,11 @@ private void GetUserRoles()
var result = UserSessionService.Instance.UpdateUserRoles().Result;
if (result)
{
this.GetUserRolesCommand.ReportProgress(() => this.RefreshAircraftTypesCommand.DoExecute(null));
this.GetAircraftUpgradesCommand.CanExecute = UserSessionService.Instance.IsModerator;
this.GetUserRolesCommand.ReportProgress(() =>
{
this.RefreshAircraftTypesCommand.DoExecute(null);
this.GetAircraftUpgradesCommand.CanExecute = UserSessionService.Instance.IsModerator;
});
}
else
{
Expand Down
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
OpenSky Flight Tracking Agent Changelog
======================================================================================

--------------------------------------------------------------------------------------
Version 0.5.1 (ALPHA5)
--------------------------------------------------------------------------------------
- Fixed crash in aircraft type editor

--------------------------------------------------------------------------------------
Version 0.5.0 (ALPHA5)
--------------------------------------------------------------------------------------
Expand Down

0 comments on commit 9c621d1

Please sign in to comment.