Fixed sidebar DMs dupes?
This commit is contained in:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user