-
-
Notifications
You must be signed in to change notification settings - Fork 464
iOS : add mode option #345
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
Conversation
bbb7cad to
0a397ce
Compare
|
Related to #335 |
|
Hello @vonovak 👋 I know you are probably buzy but can you take a moment to look at our PRs please 🙏 |
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.
hi! Thanks for the PR! I have just a few questions, and some suggestions, can you please address those? Thanks!
index.d.ts
Outdated
| options: DocumentPickerOptions<OS> | ||
| ): Promise<DocumentPickerResponse[]>; | ||
| static isCancel<IError extends { code?: string }>(err?: IError): boolean; | ||
| static releaseSecureAccess(uri: string): void; |
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.
question: would it not be more convenient for this method to accept an array of uris?
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.
Good suggestion!
index.js
Outdated
| return RNDocumentPicker.pick(opts); | ||
| } | ||
|
|
||
| function releaseSecureAccess(uri) { |
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.
this fn seems a little redundant, perhaps it'd make sense to call it inline in static releaseSecureAccess? Also, question, what is the return value here? releaseSecureAccess is defined as returning void
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.
You're right it's a mistake, I will fix this.
|
|
||
| if (!fileError) { | ||
| [result setValue:newURL.absoluteString forKey:FIELD_URI]; | ||
| [result setValue:((mode == UIDocumentPickerModeOpen) ? url : newURL).absoluteString forKey:FIELD_URI]; |
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.
just wondering, why is this needed? thanks!
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.
Because sometimes those two urls where a little bit different during my tests and I wasn't able to save documents with the new one.
23b8778 to
b22f26e
Compare
| NSMutableArray *composeResolvers; | ||
| NSMutableArray *composeRejecters; | ||
| NSString* copyDestination; | ||
| NSMutableArray *urls; |
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.
question: maybe I'm missing something; where is this array allocated?
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.
My bad, it's fixed now.
|
@RichardFevrier thanks, this looks good to me; I'll just test this out on a device some time later and merge then. FYI it'd be easier for review if you didn't force-push everything into one commit but instead kept adding new commits after each review, that way reviewer can see the changes done in between the reviews more easily. Thanks! 👍 |
|
@vonovak I'll take your advice. |
|
@RichardFevrier sorry for taking so long, I'm just taking a look at the last commit you made: 4b4fb06 - I'm always cautious of modifying a collection while looping over it (although I don't know the specifics of objective-C): Would you please use one of the solutions from https://stackoverflow.com/questions/111866/best-way-to-remove-from-nsmutablearray-while-iterating? Also, just wondering, what was the reason for the change? Thank you so much and sorry for taking so long! |
|
hello @RichardFevrier and thanks for the PR! Sorry I took so long. Would you be interested in becoming a collaborator on the repository? Thank you! 🙂 |
|
Hello @vonovak thank you for taking the time to review my work! |
|
@RichardFevrier great! Let me add you as a collaborator; feel free to do what you see fit in the repo - you'll be able to create branches directly in the repo (no need for forks), you can close issues, improve docs, work on whatever you want, as much or as little as you want, no pressure :) If you wanna discuss something, we can do that here or reach out to me on twitter. Thanks! |
|
Great, thanks! I look forward to working on it 😌 |
* upstream/master: (22 commits) 5.0.2 fix: copyTo on android to put the file in a uniquely named dir (react-native-documents#397) 5.0.1 Fix copyFile on Android. (react-native-documents#392) chore: document RN blob support 5.0.0 support only android >=5 (API 21) (react-native-documents#386) [Android][Google Drive] Download file from google drive then cache in local storage (react-native-documents#264) 4.3.0 [Windows] Implementing Folder Picker support (react-native-documents#380) Fix crash on iOS (react-native-documents#383) chore: deleted duplicate test case (react-native-documents#375) chore: change readme wording 4.2.0 iOS : add mode option (react-native-documents#345) chore: update comment for closing issues (react-native-documents#373) chore: update discussions in readme (react-native-documents#372) chore: introduce GH discussions (react-native-documents#371) chore: add issue actions (react-native-documents#369) chore: update provided file type shortcuts ...
No description provided.