Skip to content

Commit

Permalink
fixup! feat(ImportEmailsDialog): test and import lists
Browse files Browse the repository at this point in the history
  • Loading branch information
DorraJaouad committed Nov 27, 2024
1 parent 1e7c6ca commit 3811f7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/components/ConversationSettings/LobbySettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

<ImportEmailsDialog v-if="isImportEmailsDialogOpen"
:token="token"
container=".lobby-general"
@close="isImportEmailsDialogOpen = false" />
</div>
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/components/ImportEmailsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const listImport = ref(null)

const props = defineProps<{
token: string,
container?: string,
}>()
const emit = defineEmits<{
(event: 'close'): void,
Expand Down Expand Up @@ -50,11 +51,7 @@ function triggerImport() {
*/
function importList(event: Event) {
const file = (event.target as HTMLInputElement).files?.[0]
if (!file) {
importedFile.value = null
}

importedFile.value = file
importedFile.value = file ?? null

testList(importedFile.value)
}
Expand Down Expand Up @@ -88,6 +85,7 @@ async function submitList(file: File) {
try {
await importEmails(props.token, file, false)
showSuccess(t('spreed', 'Participants added successfully'))
emit('close')
} catch (e) {
showError(t('spreed', 'Error while adding participants'))
console.error(e)
Expand All @@ -100,6 +98,7 @@ async function submitList(file: File) {
:name="t('spreed', 'Import e-mail participants')"
size="small"
close-on-click-outside
:container="container"
@update:open="emit('close')">
<!--native file picker, hidden -->
<input id="list-upload"
Expand Down

0 comments on commit 3811f7b

Please sign in to comment.