diff --git a/src/Store/make-in-memory-store.ts b/src/Store/make-in-memory-store.ts index dbca22c..2820030 100644 --- a/src/Store/make-in-memory-store.ts +++ b/src/Store/make-in-memory-store.ts @@ -14,7 +14,7 @@ type LegacyWASocket = ReturnType type AnyWASocket = ReturnType export const waChatKey = (pin: boolean) => ({ - key: (c: Chat) => (pin ? (c.pin ? '1' : '0') : '') + (c.archive ? '0' : '1') + c.conversationTimestamp.toString(16).padStart(8, '0') + c.id, + key: (c: Chat) => (pin ? (c.pin ? '1' : '0') : '') + (c.archive ? '0' : '1') + (c.conversationTimestamp ? c.conversationTimestamp.toString(16).padStart(8, '0') :'') + c.id, compare: (k1: string, k2: string) => k2.localeCompare (k1) })