fix(FilePickerBuilder): correctly return array / plain value depending on multiselect by susnux · Pull Request #1775 · nextcloud-libraries/nextcloud-dialogs

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

…g on multiselect

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

@susnux susnux requested review from ShGKme and artonge

May 11, 2025 15:58

@susnux susnux added bug

Something isn't working

3. to review labels

May 11, 2025

@susnux

Copy link Copy Markdown

Contributor Author

susnux commented

May 11, 2025

/backport to stable6

backportbot[bot] reacted with thumbs up emoji backportbot[bot] reacted with hooray emoji backportbot[bot] reacted with eyes emoji

@rotdrop

Copy link Copy Markdown

rotdrop commented

May 11, 2025

The changed line 101 contains a duplicated check for "multiselect". I suppose this is not intentional?

@susnux

Copy link Copy Markdown

Contributor Author

susnux commented

May 11, 2025

The changed line 101 contains a duplicated check for "multiselect". I suppose this is not intentional?

Not sure what you mean?

@rotdrop

Copy link Copy Markdown

rotdrop commented

May 11, 2025

The changed line 101 contains a duplicated check for "multiselect". I suppose this is not intentional?

Not sure what you mean?

Line 101 after applying your commit:

return nodes.map((node) => node.path) as (IsMultiSelect extends true ? string[] : string)

This is already in the code path where multiselect is true. Ok. I suppose this is still needed in order to persuade TypeScript to deduce the correct return type ...

@skjnldsv skjnldsv merged commit eba2e00 into main

May 12, 2025

11 checks passed

@skjnldsv skjnldsv deleted the fix/filepicker-pick-return branch

May 12, 2025 07:40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@skjnldsv skjnldsv skjnldsv approved these changes

@artonge artonge Awaiting requested review from artonge

@ShGKme ShGKme Awaiting requested review from ShGKme

Assignees

No one assigned

Labels

3. to review bug

Something isn't working

Projects

None yet

Milestone

No milestone

3 participants

@susnux @rotdrop @skjnldsv