Update fileDialog.hs

This commit is contained in:
千住柱間 2025-08-28 01:56:51 +00:00
commit 264a28aea4

View file

@ -22,8 +22,7 @@ selectFolder :: FileDialog -> ApplicationWindow -> (Maybe String -> IO ()) -> IO
selectFolder fd w k =
fileDialogSelectFolder fd (Just w) (Nothing :: Maybe Cancellable) $ Just $ \_ r -> do
mbPath <- runMaybeT $ do
f <- MaybeT $ handleDialogError (\_ _ -> pure Nothing)
(fileDialogSelectFolderFinish fd r)
f <- MaybeT $ handleDialogError (\_ _ -> pure Nothing) (fileDialogSelectFolderFinish fd r)
p <- MaybeT $ fileGetPath f
p <$ (liftIO (doesDirectoryExist p) >>= guard)
k mbPath