Skip to content

Commit

Permalink
fix: display proper file name in guest name picker
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <[email protected]>
  • Loading branch information
elzody committed Apr 25, 2024
1 parent b44cb56 commit a4046a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/components/GuestNamePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
:show.sync="show">
<div class="modal__content">
<h3>
<NcIconSvgWrapper v-if="mimeTypeIcon !== null"
<NcIconSvgWrapper v-if="file.icon !== null"
:inline="true"
:svg="mimeTypeIcon"
:svg="file.icon"
:size="35" />
{{ t('richdocuments', fileName) }}
{{ file.name }}
</h3>

<p>
Expand Down Expand Up @@ -55,19 +55,25 @@ export default {
type: Function,
default: () => {},
},
fileName: {
type: String,
default: '',
},
},
data() {
return {
guestName: '',
fileName: '',
mimeTypeIcon: null,
show: true,
file: {
name: this.fileName,
icon: null,
},
}
},
async mounted() {
const fileName = document.getElementById('filename').value
const name = document.getElementById('filename').value
const mimeTypeIcon = async () => {
const url = document.getElementById('mimetypeIcon').value
let res
Expand All @@ -81,8 +87,10 @@ export default {
return (res.status === 200) ? res.data : null
}
this.fileName = fileName
this.mimeTypeIcon = await mimeTypeIcon()
this.file = {
name: this.file.name === '' ? name : this.file.name,
icon: await mimeTypeIcon(),
}
},
methods: {
Expand Down
1 change: 1 addition & 0 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export default {
'../components/GuestNamePicker.vue')
spawnDialog(GuestNamePicker, {
fileName: this.filename.replace('/', ''),
onSubmit: async (guestName) => {
this.guestName = guestName
await this.load()
Expand Down

0 comments on commit a4046a1

Please sign in to comment.