Commit 5e0aa09 1 parent 4e73046 commit 5e0aa09 Copy full SHA for 5e0aa09
File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {
13
13
useUploader
14
14
} from '@w3ui/react'
15
15
import { gatewayHost } from '../components/services'
16
- import { useState } from 'react'
16
+ import { useEffect , useState } from 'react'
17
17
import { RadioGroup } from '@headlessui/react'
18
18
import { H2 } from './Text'
19
19
@@ -62,14 +62,23 @@ export const Uploading = ({
62
62
</ div >
63
63
)
64
64
65
- export const Errored = ( { error } : { error : any } ) : JSX . Element => (
66
- < div className = 'flex flex-col items-center' >
67
- < h1 >
68
- ⚠️ Error: failed to upload file: { error . message }
69
- </ h1 >
70
- < p > Check the browser console for details.</ p >
71
- </ div >
72
- )
65
+ export const Errored = ( { error } : { error : any } ) : JSX . Element => {
66
+ useEffect ( ( ) => {
67
+ if ( error != null ) {
68
+ // eslint-disable-next-line no-console
69
+ console . error ( 'Uploader Error:' , error )
70
+ }
71
+ } , [ error ] )
72
+
73
+ return (
74
+ ( < div className = 'flex flex-col items-center' >
75
+ < h1 >
76
+ ⚠️ Error: failed to upload file: { error . message }
77
+ </ h1 >
78
+ < p > Check the browser console for details.</ p >
79
+ </ div > )
80
+ ) ;
81
+ }
73
82
74
83
interface DoneProps {
75
84
file ?: File
You can’t perform that action at this time.
0 commit comments