Skip to content

Commit 0dae088

Browse files
committed
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 <[email protected]>
1 parent 359000c commit 0dae088

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/OC/dialogs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,13 @@ const Dialogs = {
278278
} else {
279279
builder.setButtonFactory((nodes, path) => {
280280
const buttons = []
281-
const node = nodes?.[0]?.attributes?.displayName || nodes?.[0]?.basename
282-
const target = node || basename(path)
281+
const [node] = nodes
282+
const target = node?.displayname || node?.basename || basename(path)
283283

284284
if (type === FilePickerType.Choose) {
285285
buttons.push({
286286
callback: legacyCallback(callback, FilePickerType.Choose),
287-
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: node }) : t('core', 'Choose'),
287+
label: node && !this.multiSelect ? t('core', 'Choose {file}', { file: target }) : t('core', 'Choose'),
288288
type: 'primary',
289289
})
290290
}

0 commit comments

Comments
 (0)