Fixed sidebar DMs dupes?

This commit is contained in:
2025-10-26 21:11:12 +01:00
parent 903d0d2fa6
commit 990653cb2f
+12 -11
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( [
app.messages ...new Set(
.sort((a, b) => a.timestamp - b.timestamp) app.messages
.flatMap((m) => [m.from, m.channel_id]) .sort((a, b) => a.timestamp - b.timestamp)
.filter((id) => id !== app.profile?.id) .flatMap((m) => [m.from, m.channel_id])
.map((id) => app.getUserById(id)) .filter((id) => id !== app.profile?.id)
) ),
), ].map((id) => app.getUserById(id))
].filter((v) => !!v); )
).filter((v) => !!v);
app.setDms(users); app.setDms(users);