fix(core): correctly show displayname when picking a file

Ensure that the display name is shown instead of the filename (important for public shares).
Fixed in the library but the legacy wrapper still uses it.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/53291/head
Ferdinand Thiessen 2025-06-03 14:20:13 +07:00
parent 609c25acfc
commit 3dea8f7fec
1 changed files with 3 additions and 3 deletions

@ -278,13 +278,13 @@ const Dialogs = {
} else {
builder.setButtonFactory((nodes, path) => {
const buttons = []
const node = nodes?.[0]?.attributes?.displayName || nodes?.[0]?.basename
const target = node || basename(path)
const [node] = nodes
const target = node?.displayname || node?.basename || basename(path)
if (type === FilePickerType.Choose) {
buttons.push({
callback: legacyCallback(callback, FilePickerType.Choose),
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: node }) : t('core', 'Choose'),
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: target }) : t('core', 'Choose'),
type: 'primary',
})
}