chore: Update translations

This commit is contained in:
2023-09-12 14:15:07 +00:00
parent 15ffa7d4b4
commit e77b9928d0
63 changed files with 191 additions and 193 deletions

View File

@ -34,7 +34,7 @@ export class Nip4ChatSystem extends ExternalStore<Array<Chat>> implements ChatSy
const dms = this.#cache.snapshot();
const dmSince = dms.reduce(
(acc, v) => (v.created_at > acc && v.kind === EventKind.DirectMessage ? (acc = v.created_at) : acc),
0,
0
);
this.#log("Loading DMS since %s", new Date(dmSince * 1000));
@ -49,15 +49,12 @@ export class Nip4ChatSystem extends ExternalStore<Array<Chat>> implements ChatSy
listChats(pk: string): Chat[] {
const myDms = this.#nip4Events();
const chats = myDms.reduce(
(acc, v) => {
const chatId = inChatWith(v, pk);
acc[chatId] ??= [];
acc[chatId].push(v);
return acc;
},
{} as Record<string, Array<NostrEvent>>,
);
const chats = myDms.reduce((acc, v) => {
const chatId = inChatWith(v, pk);
acc[chatId] ??= [];
acc[chatId].push(v);
return acc;
}, {} as Record<string, Array<NostrEvent>>);
return [...Object.entries(chats)].map(([k, v]) => Nip4ChatSystem.createChatObj(k, v));
}