mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-05 22:03:50 +03:00
Merge pull request #3031 from urbit/lf/links-unread
links: fix unread counts
This commit is contained in:
commit
0de4bdb3bb
@ -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>
|
||||
);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user