collections: loosen property access in unread marking

Fixes urbit/landscape#999
This commit is contained in:
Liam Fitzgerald 2021-06-28 12:06:09 +10:00
parent 2dd31e8cf6
commit f630f6bf0d
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -46,8 +46,8 @@ export function LinkBlocks(props: LinkBlocksProps) {
);
useEffect(() => {
const { unreads } = useHarkState
.getState().unreads.graph?.[association.resource]?.['/'];
const unreads = useHarkState.getState()
.unreads.graph?.[association.resource]?.['/']?.unreads || new Set<string>();
Array.from((unreads as Set<string>)).forEach((u) => {
airlock.poke(markEachAsRead(association.resource, '/', u));
});