Merge pull request #137 from 13x-tech/fix/note-to-self-sort
sort bug in the event that your pubkey is the 2nd item in the list
This commit is contained in:
commit
a8414d2b0f
@ -57,8 +57,9 @@ export default function MessagesPage() {
|
||||
<div className="btn" onClick={() => markAllRead()}>Mark All Read</div>
|
||||
</div>
|
||||
{chats.sort((a, b) => {
|
||||
if(b.pubkey === myPubKey) return 1
|
||||
return b.newestMessage - a.newestMessage
|
||||
return a.pubkey === myPubKey ? -1 :
|
||||
b.pubkey === myPubKey ? 1 :
|
||||
b.newestMessage - a.newestMessage
|
||||
}).map(person)}
|
||||
</>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user