From 3dea8f7fec2f6202f63304101d9494b478e7b5d8 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 3 Jun 2025 14:20:13 +0200 Subject: [PATCH] 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 --- core/src/OC/dialogs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/OC/dialogs.js b/core/src/OC/dialogs.js index c10f676701d..5c5e8cf5887 100644 --- a/core/src/OC/dialogs.js +++ b/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', }) }