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 className="btn" onClick={() => markAllRead()}>Mark All Read</div>
|
||||||
</div>
|
</div>
|
||||||
{chats.sort((a, b) => {
|
{chats.sort((a, b) => {
|
||||||
if(b.pubkey === myPubKey) return 1
|
return a.pubkey === myPubKey ? -1 :
|
||||||
return b.newestMessage - a.newestMessage
|
b.pubkey === myPubKey ? 1 :
|
||||||
|
b.newestMessage - a.newestMessage
|
||||||
}).map(person)}
|
}).map(person)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user