Skip to content

Commit

Permalink
Fix "Computer" button crashing the app on linux (#245)
Browse files Browse the repository at this point in the history
* Fix "Computer" crashing the app on linux

* remove unnecessary using added by accident
  • Loading branch information
adryzz authored Oct 11, 2021
1 parent 2211edf commit c6a4124
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Vignette.Game/Settings/Components/SettingsDirectoryBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under NPOSLv3. See LICENSE for details.

using System.IO;
using osu.Framework;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
Expand Down Expand Up @@ -53,7 +54,19 @@ protected override void InitializeControl()
}
});

currentDirectory.ValueChanged += e => Current.Value = e.NewValue.FullName;
currentDirectory.ValueChanged += updateValue;
}

private void updateValue(ValueChangedEvent<DirectoryInfo> e)
{
if (RuntimeInfo.IsUnix && e.NewValue == null) //if we are on "Computer" on unix
{
Current.Value = "/";
}
else
{
Current.Value = e.NewValue.FullName;
}
}

public Popover GetPopover() => new FluentPopover
Expand Down

0 comments on commit c6a4124

Please sign in to comment.