@@ -83,7 +83,7 @@ export const Image = (props: Props) => {
83
83
const canClick = onClick && ! pending ;
84
84
const role = canClick ? 'button' : undefined ;
85
85
86
- const onErrorUrlFilterering = useCallback ( ( ) => {
86
+ const onErrorUrlFiltering = useCallback ( ( ) => {
87
87
if ( mounted && url && urlToLoad === '' && onError ) {
88
88
onError ( ) ;
89
89
setPending ( false ) ;
@@ -96,19 +96,19 @@ export const Image = (props: Props) => {
96
96
useEffect ( ( ) => {
97
97
if ( mounted && url === '' ) {
98
98
setPending ( false ) ;
99
- onErrorUrlFilterering ( ) ;
99
+ onErrorUrlFiltering ( ) ;
100
100
}
101
101
102
102
if ( mounted && imageBroken && urlToLoad === '' ) {
103
103
setPending ( false ) ;
104
- onErrorUrlFilterering ( ) ;
104
+ onErrorUrlFiltering ( ) ;
105
105
}
106
106
107
107
if ( url ) {
108
108
setPending ( false ) ;
109
109
setMounted ( ! loading && ! pending ) ;
110
110
}
111
- } , [ imageBroken , loading , mounted , onErrorUrlFilterering , pending , url , urlToLoad ] ) ;
111
+ } , [ imageBroken , loading , mounted , onErrorUrlFiltering , pending , url , urlToLoad ] ) ;
112
112
113
113
if ( mounted && imageBroken ) {
114
114
return (
@@ -145,7 +145,7 @@ export const Image = (props: Props) => {
145
145
} }
146
146
data-attachmentindex = { attachmentIndex }
147
147
>
148
- { ! mounted ? (
148
+ { ! mounted || ! urlToLoad ? (
149
149
< div
150
150
className = "module-image__loading-placeholder"
151
151
style = { {
@@ -161,7 +161,7 @@ export const Image = (props: Props) => {
161
161
</ div >
162
162
) : (
163
163
< img
164
- onError = { onErrorUrlFilterering }
164
+ onError = { onErrorUrlFiltering }
165
165
className = { clsx ( 'module-image__image' , forceSquare ? 'module-image__image-cover' : '' ) }
166
166
alt = { alt }
167
167
style = { {
0 commit comments