Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(ActionInsertLink): Apparently filePicker always returns an arra…
…y now

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed May 6, 2025
commit 915fe39d6b02382161941e4b37a50d38e912ca1a
8 changes: 6 additions & 2 deletions src/components/Menu/ActionInsertLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ export default {
.build()

filePicker.pick()
.then((file) => {
.then((files) => {
const client = OC.Files.getClient()
client.getFileInfo(file).then((_status, fileInfo) => {
client.getFileInfo(files[0]).then((_status, fileInfo) => {
const url = new URL(generateUrl(`/f/${fileInfo.id}`), window.origin)
this.setLink(url.href, fileInfo.name)
this.startPath = fileInfo.path + (fileInfo.type === 'dir' ? `/${fileInfo.name}/` : '')
Expand All @@ -163,6 +163,7 @@ export default {
this.$refs.buttonFile.$el.focus()
})
},

/**
* Allow user to enter an URL manually
* Triggered when by the "link url" button
Expand All @@ -184,6 +185,7 @@ export default {
}
this.isInputMode = true
},

/**
* Save user entered URL as a link markup
* Triggered when the user submits the ActionInput
Expand Down Expand Up @@ -228,6 +230,7 @@ export default {
}
chain.focus().run()
},

/**
* Remove link markup at current position
* Triggered by the "remove link" button
Expand All @@ -236,6 +239,7 @@ export default {
this.$editor.chain().unsetLink().focus().run()
this.menuOpen = false
},

linkPicker() {
getLinkWithPicker(null, true)
.then(link => {
Expand Down