Skip to content

Commit 364cd02

Browse files
Merge pull request #53347 from nextcloud/backport/53291/stable31
[stable31] fix(core): correctly show displayname when picking a file
2 parents 2f3ceec + 9a624c3 commit 364cd02

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
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
}

dist/core-login.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-login.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)