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

Add files and index to filter callback #731

Merged
merged 7 commits into from
Mar 18, 2022

Conversation

mkszepp
Copy link
Contributor

@mkszepp mkszepp commented Mar 10, 2022

Issue #712

@mkszepp
Copy link
Contributor Author

mkszepp commented Mar 10, 2022

@gilest during my changes i have discoverd, that in the filter there was passed one time the file as type UploadFile & one time as file.

Maybe there would be better, to pass alway as File or what do you think?

export interface SelectFileModifierArgs extends ModifierArgs {
named: {
filter?: (file: File) => boolean;
onFilesSelected?: (files: UploadFile[]) => void;
};
}

filter?: (file: UploadFile) => boolean;

@gilest
Copy link
Collaborator

gilest commented Mar 15, 2022

Thanks for opening this and sorry for the delay in reviewing.

in the filter there was passed one time the file as type UploadFile & one time as file.

Maybe there would be better, to pass alway as File or what do you think?

Yes, I agree.

You've uncovered some awkward typing which I'd like to fix up here. Have made some suggestions below 👇🏻

@mkszepp mkszepp requested a review from gilest March 16, 2022 06:59
@gilest gilest changed the title Extend filter function arguments Add files and index to filter callback Mar 18, 2022
@gilest gilest merged commit 694ca2b into adopted-ember-addons:master Mar 18, 2022
@gilest
Copy link
Collaborator

gilest commented Mar 18, 2022

Thank you @mkszepp

Released in 5.0.0-beta.9

@mkszepp mkszepp deleted the add-filter-arguments branch March 18, 2022 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants