Skip to content

Commit

Permalink
fix: close import dialog on publish
Browse files Browse the repository at this point in the history
  • Loading branch information
hyamero committed Aug 21, 2024
1 parent 4138253 commit a6a439b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/event-setup/components/import-participants-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function ImportParticipantsDialog() {
setLoading(true);
if (parsedAttendees.length === 0) {
toast.error("No attendees to import");
setImportDialog(false);
return;
}

Expand All @@ -44,6 +45,7 @@ export default function ImportParticipantsDialog() {
);
} catch (err: any) {
toast.error(err.message);
setImportDialog(false);
}
});

Expand All @@ -52,10 +54,13 @@ export default function ImportParticipantsDialog() {
}, 500);

toast.success("Certificates added");
setImportDialog(false);
} catch (err: any) {
toast.error(err.message);
setImportDialog(false);
}
setLoading(false);
setImportDialog(false);
};

const cancelImport = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/event-setup/components/xlsx-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function XlsxForm() {
_parsedAttendees.forEach((m, i) => {
const data = schema.safeParse(m);
if (!data.success) {
toast.error("Contains invalid data");
toast.error("Contains invalid data, please check the format");
console.log(i, data.error, m);
invalid = true;
return;
Expand Down

0 comments on commit a6a439b

Please sign in to comment.