File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,26 +165,28 @@ function handleReplyClick(messageId) {
165165 }
166166
167167 replyToMessage = message ;
168- renderReplyPreview ( ) ;
168+ renderReplyPreview ( message ) ;
169169}
170170
171- function renderReplyPreview ( ) {
171+ function renderReplyPreview ( msg ) {
172172 const replyPreview = document . getElementById ( "replyPreview" ) ;
173173 const replyPreviewText = document . getElementById ( "replyPreviewText" ) ;
174174
175- if ( ! replyToMessage ) {
175+ const target = msg ?? replyToMessage ;
176+
177+ if ( ! target ) {
176178 replyPreview . classList . add ( "hidden" ) ;
177179 replyPreviewText . textContent = "" ;
178180 return ;
179181 }
180182
181- replyPreviewText . textContent = `${ replyToMessage . sender } : ${ replyToMessage . message } ` ;
183+ replyPreviewText . textContent = `${ target . sender } : ${ target . message } ` ;
182184 replyPreview . classList . remove ( "hidden" ) ;
183185}
184186
185187function clearReplyPreview ( ) {
186188 replyToMessage = null ;
187- renderReplyPreview ( ) ;
189+ renderReplyPreview ( null ) ;
188190}
189191
190192async function reactToMessage ( id , reaction ) {
You can’t perform that action at this time.
0 commit comments