Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| const existingEntry = await getEntry({address: entry.address}); | ||
| if (existingEntry) { | ||
| const mergedChains = [...(existingEntry.chains || []), ...(entry.chains || [])]; | ||
| const mergedChains = [...(entry.chains || [])]; |
There was a problem hiding this comment.
| const mergedChains = [...(entry.chains || [])]; | |
| const mergedChains = [...(existingEntry.chains || []), ...(entry.chains || [])]; |
Once you update an entry for a given chain, you want to use the most up-to-date version of it, aka the one in the storage (from existingEntry), not the one in the cache/state (from entry) as base.
So [...storage, ...cache]
There was a problem hiding this comment.
This way it's not possible to update the chains completely. It was only possible to add new chains to the entry, but not removing some of them. The reason for that is we were always spreading existingEntry.chains into merged chains which seemed wrong. I think that chains can be the only field to be overwritten. Can you pls provide some example when we actually need to spread the chains like this? It will help to come up with new logic for this
| allSelected.forEach(input => onUpdateStatus(input.UUID, 'pending')); | ||
| const {safeTxHash} = await sdk.txs.send({txs: transactions}); | ||
| allSelected.forEach(input => onUpdateStatus(input.UUID, 'success')); |
There was a problem hiding this comment.
I wonder if this loops should be merged into one single forof
No description provided.