Skip to content

Commit

Permalink
fix: remove toasts from upload dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
martastain committed Nov 6, 2024
1 parent 8121986 commit bff441b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions frontend/src/containers/Upload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import axios from 'axios'
import styled from 'styled-components'

import { useState, useRef, useMemo } from 'react'
import { toast } from 'react-toastify'
import { Dialog, Button, Progress } from '/src/components'

import nebula from '/src/nebula'
Expand Down Expand Up @@ -134,7 +133,7 @@ const UploadDialog = ({ onHide, assetData }) => {

const handleHide = () => {
if (status === 'uploading') {
toast.error('Upload in progress')
console.warn('Unable to close dialog: upload in progress')
return
}
onHide()
Expand All @@ -159,18 +158,11 @@ const UploadDialog = ({ onHide, assetData }) => {
})

setStatus('success')
toast.success('Upload finished')
} catch (error) {
console.error(error)
if (axios.isCancel(error)) {
console.error('Request canceled', error.message)
} else if (error.response) {
toast.error(
<>
<strong>Upload failed</strong>
<p>{error.response.data?.detail || 'Unknown error'}</p>
</>
)
console.error('Error response', error.response)
}
setBytesTransferred(0)
Expand Down

0 comments on commit bff441b

Please sign in to comment.