Skip to content
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

Check for appropriate keystore file type on upload #646

Merged
merged 12 commits into from
Dec 29, 2017
Merged

Check for appropriate keystore file type on upload #646

merged 12 commits into from
Dec 29, 2017

Conversation

aitrean
Copy link
Contributor

@aitrean aitrean commented Dec 20, 2017

@@ -18,11 +19,17 @@ function isPassRequired(file: string): boolean {
return passReq;
}

function isValidFile(rawFile: any): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried finding the rawFile expected type for file uploads, but couldn't find it either. Would be nice to have the proper typing, but any can do for now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not part of the FileReader interface?

@dternyak
Copy link
Contributor

Confirmed working! 👍

screen shot 2017-12-20 at 1 46 19 pm

const fileType = rawFile.type;
return fileType === '' || fileType === 'application/json';
}

export default class KeystoreDecrypt extends Component {
public props: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the Component<> pattern for specifying props. Mind updating to match?

@dternyak
Copy link
Contributor

@aitrean Are you planning on updating the any type based on @HenryNguyen5's suggestion?

@aitrean
Copy link
Contributor Author

aitrean commented Dec 20, 2017

Apologies, meant to add that and it slipped by me. One moment.

@dternyak dternyak changed the title Check for appropriate keystore file type on upload. Check for appropriate keystore file type on upload Dec 21, 2017
@dternyak
Copy link
Contributor

Thank you for the contribution @aitrean! :)

@dternyak dternyak merged commit 97c3280 into MyCryptoHQ:develop Dec 29, 2017
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.

4 participants