File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,15 @@ export class MessageRenderer {
461461
462462 private getMessageInfo = async ( fullMsg : GmailRes . GmailMsg ) : Promise < MessageInfo > => {
463463 const sentDate = GmailParser . findHeader ( fullMsg , 'date' ) ;
464- let sentDateStr = $ ( 'div.gK span[title]' ) . attr ( 'title' ) ;
464+ let sentDateStr : string | undefined ;
465+
466+ // Look for the date element within the specific message container
467+ const msgContainer = $ ( `div.adn[data-legacy-message-id="${ fullMsg . id } "]` ) ;
468+ if ( msgContainer . length ) {
469+ sentDateStr = msgContainer . find ( '.gK span[title]' ) . first ( ) . attr ( 'title' ) ;
470+ }
471+
472+ // fallback to formatted date from headers
465473 if ( ! sentDateStr || isNaN ( Date . parse ( sentDateStr ) ) ) {
466474 sentDateStr = sentDate ? new Date ( sentDate ) . toLocaleString ( ) : '' ;
467475 }
You can’t perform that action at this time.
0 commit comments