Skip to content

Conversation

@RichardFevrier
Copy link
Collaborator

No description provided.

@RichardFevrier RichardFevrier force-pushed the master branch 3 times, most recently from bbb7cad to 0a397ce Compare September 4, 2020 15:41
@RichardFevrier
Copy link
Collaborator Author

Related to #335

@RichardFevrier
Copy link
Collaborator Author

Hello @vonovak 👋 I know you are probably buzy but can you take a moment to look at our PRs please 🙏

@RichardFevrier
Copy link
Collaborator Author

RichardFevrier commented Oct 1, 2020

This will allow to close this and this by the way 🙂

Copy link
Member

@vonovak vonovak left a 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;
Copy link
Member

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?

Copy link
Collaborator Author

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) {
Copy link
Member

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

Copy link
Collaborator Author

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];
Copy link
Member

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!

Copy link
Collaborator Author

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.

@RichardFevrier RichardFevrier force-pushed the master branch 3 times, most recently from 23b8778 to b22f26e Compare October 6, 2020 13:38
@RichardFevrier RichardFevrier requested a review from vonovak October 6, 2020 13:44
NSMutableArray *composeResolvers;
NSMutableArray *composeRejecters;
NSString* copyDestination;
NSMutableArray *urls;
Copy link
Member

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?

Copy link
Collaborator Author

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.

@vonovak
Copy link
Member

vonovak commented Oct 7, 2020

@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! 👍

@RichardFevrier
Copy link
Collaborator Author

@vonovak I'll take your advice.
And thanks for taking the time to review my work 🙂

@vonovak
Copy link
Member

vonovak commented Dec 15, 2020

@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):

    for (NSString *uri in uris) {
        NSURL *url = [NSURL URLWithString:uri];
        [url stopAccessingSecurityScopedResource];
        for (NSURL *url in urls) { //<--- enumeration
            if ([url.absoluteString isEqual:uri]) {
                [url stopAccessingSecurityScopedResource];
                [urls removeObject:url]; //<--- modification
                break;
            }
        }
    }

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!

@vonovak vonovak merged commit 0ead2a5 into react-native-documents:master Dec 25, 2020
@vonovak
Copy link
Member

vonovak commented Dec 25, 2020

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! 🙂

@RichardFevrier
Copy link
Collaborator Author

Hello @vonovak thank you for taking the time to review my work!
I would be really happy to collaborate with you guys 🙂
I have more work that’s ready to be reviewed.
I will try to do even better work next time 😅

@vonovak
Copy link
Member

vonovak commented Jan 20, 2021

@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!

@RichardFevrier
Copy link
Collaborator Author

Great, thanks! I look forward to working on it 😌

DomiR added a commit to DomiR/react-native-document-picker that referenced this pull request Mar 30, 2021
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants