Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
YongZL committed Jan 26, 2024
1 parent 9dc1fae commit 065e4b4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
6 changes: 1 addition & 5 deletions app/blobtx/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ const BlobTX = () => {

const files = event.dataTransfer.files?.item(0)
if (!validImageTypes.includes(files?.type)) {
currentOpenState()
setLoading({ uploadImageError: 'Only PNG, JPG, JPEG, GIF formats are supported. Please select again.' })
return
}

const fileSizeInKB = files.size / 1024
if (fileSizeInKB > 128) {
currentOpenState()
setLoading({ uploadImageError: 'File size exceeding 128kB! Please select again.' })
return
}
Expand All @@ -106,13 +104,11 @@ const BlobTX = () => {
const fileSizeInKB = file.size / 1024

if (!validImageTypes.includes(file?.type)) {
currentOpenState()
setLoading({ uploadImageError: 'Only PNG, JPG, JPEG, GIF formats are supported. Please select again.' })
return
}

if (fileSizeInKB > 128) {
currentOpenState()
setLoading({ uploadImageError: 'File size exceeding 128kB! Please select again.' })
return
}
Expand All @@ -126,7 +122,7 @@ const BlobTX = () => {
}, [])

useEffect(() => {
if (loading.loading || loading.success || loading.error || shownettip) {
if (loading.loading || loading.success || loading.error || shownettip || loading.uploadImageError) {
currentOpenState()
} else {
currentCloseState()
Expand Down
6 changes: 0 additions & 6 deletions components/AToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ type ToastType = {
}

export const AToastFull: FC<ToastType> = ({ onLeftButton, className, contentClassName, onRightButton, chilren, size = '', ...other }) => {
useEffect(() => {
document.documentElement.classList.add('overflow-hidden')
return () => {
document.documentElement.classList.remove('overflow-hidden')
}
}, [])
return (
<div
id='modal'
Expand Down

0 comments on commit 065e4b4

Please sign in to comment.