Skip to content

Commit

Permalink
Viewer: Fixed bug with creating folder to save config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthysell committed Jul 8, 2021
1 parent c574585 commit 5e8f972
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Mzinga ChangeLog #

## next ##

* Viewer: Fixed bug with creating folder to save config

## v0.11.0 ##

* Engine/Viewer: Fixed bug where loading default config looked in working directory, not app entrypoint
Expand Down
3 changes: 2 additions & 1 deletion src/Mzinga.Viewer/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private ViewerConfig LoadConfig()

try
{
using FileStream inputStream = new FileStream(ViewerConfigPath, FileMode.OpenOrCreate);
using FileStream inputStream = new FileStream(ViewerConfigPath, FileMode.Open);
viewerConfig.LoadConfig(inputStream);
}
catch (Exception) { }
Expand All @@ -116,6 +116,7 @@ private void SaveConfig()
{
try
{
Directory.CreateDirectory(Path.GetDirectoryName(ViewerConfigPath));
using FileStream outputStream = new FileStream(ViewerConfigPath, FileMode.Create);
AppVM.ViewerConfig.InternalEngineConfig.CopyOptionsFrom(InternalEngineConfig.GetOptionsClone()); // Repopulate with current engine values
AppVM.ViewerConfig.SaveConfig(outputStream);
Expand Down

0 comments on commit 5e8f972

Please sign in to comment.