Skip to content

Commit

Permalink
fix(Sibedar): Fix chat preview order on sidebar (#618)
Browse files Browse the repository at this point in the history
Co-authored-by: Sara Tavares <[email protected]>
Co-authored-by: Phill Wisniewski <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent 0d99db5 commit 105c201
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/routes/files/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,11 @@
</Button>
</Controls>
{#if activeTabRoute === "chats"}
{#each $chats as chat}
{#each $chats.slice().sort((a, b) => {
const dateA = new Date(a.last_message_at || 0)
const dateB = new Date(b.last_message_at || 0)
return dateB.getTime() - dateA.getTime()
}) as chat}
<ContextMenu
hook="context-menu-sidebar-chat"
items={[
Expand Down
6 changes: 5 additions & 1 deletion src/routes/friends/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@
</Button>
</div>

{#each chats as chat}
{#each chats.slice().sort((a, b) => {
const dateA = new Date(a.last_message_at || 0)
const dateB = new Date(b.last_message_at || 0)
return dateB.getTime() - dateA.getTime()
}) as chat}
<ContextMenu
hook="context-menu-sidebar-chat"
items={[
Expand Down

0 comments on commit 105c201

Please sign in to comment.