Skip to content

Commit

Permalink
Fix macOS ShowModalAsync.
Browse files Browse the repository at this point in the history
  • Loading branch information
VPKSoft committed Jul 14, 2022
1 parent 6b0a9c2 commit ef44f93
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion amp.EtoForms/FormMain.Layout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using amp.Database.DataModel;
using amp.EtoForms.Forms;
using amp.EtoForms.Properties;
using amp.Shared.Classes;
using amp.Shared.Localization;
using Eto.Drawing;
using Eto.Forms;
Expand Down Expand Up @@ -385,7 +386,19 @@ private void CreateMenu()

private async void ManageAlbumsCommand_Executed(object? sender, EventArgs e)
{
if (await new FormAlbums(context).ShowModalAsync(this))
bool modalResult;

if (UtilityOS.IsMacOS)
{
// ReSharper disable once MethodHasAsyncOverload, Shown-event won't fire on macOS.
modalResult = new FormAlbums(context).ShowModal(this);
}
else
{
modalResult = await new FormAlbums(context).ShowModalAsync(this);
}

if (modalResult)
{
await UpdateAlbumDataSource();
}
Expand Down

0 comments on commit ef44f93

Please sign in to comment.