Loading graphql/urql/worker/cacheFunctions/commitActionLogsToCache.ts +10 −2 Original line number Diff line number Diff line Loading @@ -204,9 +204,17 @@ export const commitActionLogsToCache = ( // update emails const emails = cache.resolve(threadKey, 'emails') if (Array.isArray(emails)) { cache.link(threadKey, 'emails', [...emails, actionLogKey]) if (!Array.isArray(emails)) { console.warn( `commitActionLogsToCache: emails link error ${JSON.stringify(emails)}` ) throw Error( `commitActionLogsToCache: emails link error ${JSON.stringify(emails)}` ) } const emailsWithoutDuplicate = emails.filter(key => key !== actionLogKey) // should be sorted timestamp descending cache.link(threadKey, 'emails', [actionLogKey, ...emailsWithoutDuplicate]) // update lastEmail cache.link(threadKey, 'lastEmail', actionLogKey) Loading Loading
graphql/urql/worker/cacheFunctions/commitActionLogsToCache.ts +10 −2 Original line number Diff line number Diff line Loading @@ -204,9 +204,17 @@ export const commitActionLogsToCache = ( // update emails const emails = cache.resolve(threadKey, 'emails') if (Array.isArray(emails)) { cache.link(threadKey, 'emails', [...emails, actionLogKey]) if (!Array.isArray(emails)) { console.warn( `commitActionLogsToCache: emails link error ${JSON.stringify(emails)}` ) throw Error( `commitActionLogsToCache: emails link error ${JSON.stringify(emails)}` ) } const emailsWithoutDuplicate = emails.filter(key => key !== actionLogKey) // should be sorted timestamp descending cache.link(threadKey, 'emails', [actionLogKey, ...emailsWithoutDuplicate]) // update lastEmail cache.link(threadKey, 'lastEmail', actionLogKey) Loading