Fixed sidebar DMs dupes?

This commit is contained in:
2025-10-26 21:11:12 +01:00
parent 903d0d2fa6
commit 990653cb2f
+6 -5
View File
@@ -20,17 +20,18 @@ export default function SidebarDMs({ app }: { app: App }) {
if (!app.profile) return; if (!app.profile) return;
const load = async () => { const load = async () => {
const users = [ const users = (
...new Set(
await Promise.all( await Promise.all(
[
...new Set(
app.messages app.messages
.sort((a, b) => a.timestamp - b.timestamp) .sort((a, b) => a.timestamp - b.timestamp)
.flatMap((m) => [m.from, m.channel_id]) .flatMap((m) => [m.from, m.channel_id])
.filter((id) => id !== app.profile?.id) .filter((id) => id !== app.profile?.id)
.map((id) => app.getUserById(id))
)
), ),
].filter((v) => !!v); ].map((id) => app.getUserById(id))
)
).filter((v) => !!v);
app.setDms(users); app.setDms(users);