Merge pull request #3031 from urbit/lf/links-unread

links: fix unread counts
This commit is contained in:
matildepark 2020-06-29 23:26:13 -04:00 committed by GitHub
commit 0de4bdb3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -88,7 +88,8 @@ export class Message extends Component {
src={letter.url}
style={{
height: 'min(250px, 20vh)',
maxWidth: '80vw'
maxWidth: 'calc(100% - 36px - 1.5rem)',
objectFit: 'contain'
}}
></img>
);

View File

@ -54,9 +54,18 @@ export class LinksApp extends Component {
const seen = props.linksSeen ? props.linksSeen : {};
const selectedGroups = props.selectedGroups ? props.selectedGroups : [];
const selGroupPaths = selectedGroups.map(g => g[0]);
const totalUnseen = _.reduce(
seen,
(acc, links) => acc + _.reduce(links, (total, hasSeen) => total + (hasSeen ? 0 : 1), 0),
links,
(acc, collection, path) => {
if(selGroupPaths.length > 0
&& !selGroupPaths.includes(associations.link?.[path]?.['group-path'])) {
return acc;
}
return acc + collection.unseenCount;
},
0
);
@ -68,7 +77,6 @@ export class LinksApp extends Component {
const invites = props.invites ?
props.invites : {};
const selectedGroups = props.selectedGroups ? props.selectedGroups : [];
const listening = props.linkListening;