Skip to content
Open
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
19 changes: 10 additions & 9 deletions src/pages/bugReport/BugReportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ const BugReportForm = () => {
const mutation = useMutation({
mutationFn: (values: CreateIssuePostRequest) =>
ISSUES_API.issuesCreatePost({ createIssuePostRequest: values }),
onSuccess: (response) => {
if (response.data?.state === 'open') {
form.resetFields()
// setFileList([])
}
onSuccess: () => {
form.resetFields()
},
onError: (error) => {
console.error('Error submitting bug report:', error)
Expand Down Expand Up @@ -62,11 +59,15 @@ const BugReportForm = () => {
</p>
}>
<span>{t('reportBug.description')}</span>
{mutation.isSuccess && mutation.data?.data && (
{mutation.isSuccess && (
<Alert severity="success" sx={{ marginBottom: 2 }}>
<a href={mutation.data.data.url} target="_blank" rel="noopener noreferrer">
{t('reportBug.viewIssue')} (Github)
</a>
{mutation.data?.data?.url ? (
<a href={mutation.data.data.url} target="_blank" rel="noopener noreferrer">
{t('reportBug.viewIssue')} (Github)
Comment thread
eran132 marked this conversation as resolved.
Outdated
</a>
) : (
t('reportBug.success', { defaultValue: 'Bug report submitted successfully!' })
)}
Comment thread
eran132 marked this conversation as resolved.
Outdated
</Alert>
)}

Expand Down
Loading