Though optional, every message SHOULD have a "Message-ID:" field.
I appreciate this is an uncommon scenario, but if incoming emails don't have the Message-ID field then the email toggling can get screwed up in the web interface.
Without a message ID, the this.state.activeEmail === email.messageId check becomes null === undefined, which of course falls to the else block and sets activeEmail to undefined.
Once that's happened, the isOpen attribute of the Email component becomes true for any email that has no messageId property:
Hi there.
Thanks for this project.
According to RFC 2822:
I appreciate this is an uncommon scenario, but if incoming emails don't have the
Message-ID
field then the email toggling can get screwed up in the web interface.The toggle code in App.js looks like this:
Without a message ID, the
this.state.activeEmail === email.messageId
check becomesnull === undefined
, which of course falls to theelse
block and setsactiveEmail
toundefined
.Once that's happened, the
isOpen
attribute of theEmail
component becomestrue
for any email that has nomessageId
property:I haven't tested, but presumably
state.activeEmail
could be changed to something likeactiveIndex
and make use of the map index.