-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[menu-bar] Migrate FilePicker to Expo Modules #132
[menu-bar] Migrate FilePicker to Expo Modules #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I'll start helping out with this. Just a few comments
AsyncFunction("pickFolder"){ (promise: Promise) in | ||
DispatchQueue.main.async { | ||
let panel = NSOpenPanel() | ||
panel.allowsMultipleSelection = false | ||
panel.canChooseFiles = false | ||
panel.canChooseDirectories = true | ||
panel.canCreateDirectories = true | ||
|
||
if panel.runModal() == NSApplication.ModalResponse.OK { | ||
promise.resolve(panel.url?.path) | ||
} else { | ||
promise.reject(Exception(name: "FILE_PICKER_ERROR", description: "NSModalResponseCancel")) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Name("FilePicker") | ||
|
||
AsyncFunction("pickFileWithFilenameExtension"){ (filenameExtensions: [String], prompt: String, promise: Promise) in | ||
DispatchQueue.main.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooo many spaces 🙉
89807c4
to
f1089ff
Compare
247da92
to
19d0d03
Compare
e8d8371
to
33dd18b
Compare
Co-authored-by: Alan Hughes <30924086+alanjhughes@users.noreply.github.com>
c65db43
to
5f7bb65
Compare
Why
Now that expo modules supports macOS, we can start to slowly migrate our modules to use the Sweet API
How
Migrate FilePicker to use Expo Modules
Test Plan
Screen.Recording.2024-01-09.at.18.50.09.mov