chore: cleaner user device cache check

This commit is contained in:
Adhiraj Singh
2023-02-21 11:56:16 +05:30
parent 34f8f60d31
commit 30328eebe1

View File

@@ -147,8 +147,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
for(let jid of jids) {
const user = jidDecode(jid)?.user
jid = jidNormalizedUser(jid)
if(userDevicesCache.has(user!) && useCache) {
const devices = userDevicesCache.get<JidWithDevice[]>(user!)!
const devices = userDevicesCache.get<JidWithDevice[]>(user!)
if(devices && useCache) {
deviceResults.push(...devices)
logger.trace({ user }, 'using cache for devices')