File tree Expand file tree Collapse file tree 1 file changed +21
-19
lines changed
Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -64,23 +64,25 @@ const SpeechBubble = ({
6464 if ( hash && sameId ) setHighlight ( true ) ;
6565
6666 // ---------- Image validation logic ----------
67- const url = `${ process . env . NEXT_PUBLIC_ASSETS_URL } /img/mp-240/${ uid } .jpg` ;
68- const img = new Image ( ) ;
67+ if ( uid ) {
68+ const url = `${ process . env . NEXT_PUBLIC_ASSETS_URL } /img/mp-240/${ uid } .jpg` ;
69+ const img = new Image ( ) ;
6970
70- img . onload = ( ) => {
71- setImgValid ( true ) ;
72- setImgUrl ( url ) ;
73- } ;
74- img . onerror = ( ) => {
75- setImgValid ( false ) ;
76- setImgUrl ( "" ) ;
77- } ;
78- img . src = url ;
71+ img . onload = ( ) => {
72+ setImgValid ( true ) ;
73+ setImgUrl ( url ) ;
74+ } ;
75+ img . onerror = ( ) => {
76+ setImgValid ( false ) ;
77+ setImgUrl ( "" ) ;
78+ } ;
79+ img . src = url ;
7980
80- return ( ) => {
81- img . onload = null ;
82- img . onerror = null ;
83- } ;
81+ return ( ) => {
82+ img . onload = null ;
83+ img . onerror = null ;
84+ } ;
85+ }
8486 } , [ asPath , uid , index ] ) ;
8587
8688 return (
@@ -93,7 +95,7 @@ const SpeechBubble = ({
9395 < EmptyMP />
9496 ) : (
9597 < >
96- { imgValid ? (
98+ { /* { imgValid ? (
9799 <img
98100 src={imgUrl}
99101 width={36}
@@ -102,9 +104,9 @@ const SpeechBubble = ({
102104 className="p"
103105 fetchPriority={index < 10 ? "high" : "auto"}
104106 />
105- ) : (
106- < EmptyMP />
107- ) }
107+ ) : ( */ }
108+ < EmptyMP />
109+ { /* )} */ }
108110 </ >
109111 ) }
110112 </ div >
You can’t perform that action at this time.
0 commit comments