Skip to content

Commit

Permalink
Merge pull request #91 from nebulabroadcast/martastain/fix-dialog-toa…
Browse files Browse the repository at this point in the history
…st-issue

Fix toasts being obscured by dialog shade
  • Loading branch information
martastain authored Nov 6, 2024
2 parents aa239e3 + bff441b commit da11af2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const StyledDialog = styled.dialog`
&::backdrop {
background-color: rgba(0, 0, 0, 0);
backdrop-filter: none;
z-index: 999; // P5e04
}
&[open] {
Expand Down
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 da11af2

Please sign in to comment.