Browse Source

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 5 months ago
parent
commit
3dea8f7fec
  1. 6
      core/src/OC/dialogs.js

6
core/src/OC/dialogs.js

@ -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',
})
}

Loading…
Cancel
Save