chore: update note vault change correctly

This commit is contained in:
Aman Harwara
2023-09-15 14:26:48 +05:30
parent 3d0c08e283
commit aab67ff5d8

View File

@@ -45,6 +45,15 @@ export const useItemVaultInfo = (item: DecryptedItemInterface): ItemVaultInfo =>
})
}, [application.items, vaultRef])
useEffect(() => {
return application.items.streamItems(ContentType.TYPES.Note, ({ changed }) => {
const matchingItem = changed.find((note) => note.uuid === item.uuid)
if (matchingItem) {
updateInfo()
}
})
}, [application.items, item.uuid, updateInfo])
return {
vault,
lastEditedByContact,