Skip to content

Commit

Permalink
fix(attachments): add missing file picker confirm
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny committed Oct 1, 2024
1 parent 172b33f commit 812233d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ import Paperclip from 'vue-material-design-icons/Paperclip.vue'
import Plus from 'vue-material-design-icons/Plus.vue'
import { generateUrl, getBaseUrl } from '@nextcloud/router'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import { FilePickerType, getFilePickerBuilder, showError } from '@nextcloud/dialogs'

Check warning on line 91 in src/components/Editor/Attachments/AttachmentsList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Attachments/AttachmentsList.vue#L91

Added line #L91 was not covered by tests
import logger from '../../../utils/logger.js'
import {
uploadLocalAttachment,
Expand Down Expand Up @@ -154,7 +154,11 @@ export default {
})
},
async openFilesModal() {
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment')).setMultiSelect(false).build()
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment'))
.setMultiSelect(false)
// TODO: migrate to addButton() => requires a translation change so no backporting
.setType(FilePickerType.Choose)
.build()

Check warning on line 161 in src/components/Editor/Attachments/AttachmentsList.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Editor/Attachments/AttachmentsList.vue#L160-L161

Added lines #L160 - L161 were not covered by tests
try {
const filename = await picker.pick(t('calendar', 'Choose a file to share as a link'))
if (!this.isDuplicateAttachment(filename)) {
Expand Down

0 comments on commit 812233d

Please sign in to comment.