From c494291ed723031fd7d601df9213aa254e3a34d8 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Thu, 13 Jun 2024 03:59:59 +0300 Subject: [PATCH] maybe mac fix 2 --- loader/src/platform/mac/util.mm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/loader/src/platform/mac/util.mm b/loader/src/platform/mac/util.mm index b6a2728f..077c0690 100644 --- a/loader/src/platform/mac/util.mm +++ b/loader/src/platform/mac/util.mm @@ -164,9 +164,10 @@ GEODE_DLL Task> file::pick(file::PickMode mode, fi using RetTask = Task>; [FileDialog dispatchFilePickerWithMode:mode options:options multiple:false onCompletion: ^(FileResult result) { if (result.isOk()) { - return RetTask::immediate(std::move(result.unwrap()[0])); + std::filesystem::path path = result.unwrap()[0]; + return RetTask::immediate(Ok(path)); } else { - return RetTask::immediate(result.err().unwrap()); + return RetTask::immediate(Err(result.err().unwrap())); } }]; } @@ -174,11 +175,7 @@ GEODE_DLL Task> file::pick(file::PickMode mode, fi GEODE_DLL Task>> file::pickMany(file::FilePickOptions const& options) { using RetTask = Task>>; [FileDialog dispatchFilePickerWithMode:mode options:options multiple:true onCompletion: ^(FileResult result) { - if (result.isOk()) { - return RetTask::immediate(result); - } else { - return RetTask::immediate(Err("Couldn't open file")); - } + return RetTask::immediate(result); }]; }