diff --git a/pkg/interface/link/src/js/components/lib/channel-sidebar.js b/pkg/interface/link/src/js/components/lib/channel-sidebar.js index a845abd90..aa1d72515 100644 --- a/pkg/interface/link/src/js/components/lib/channel-sidebar.js +++ b/pkg/interface/link/src/js/components/lib/channel-sidebar.js @@ -10,7 +10,7 @@ export class ChannelsSidebar extends Component { const { props, state } = this; let privateChannel = - Object.keys(props.paths) + Object.keys(props.groups) .filter((path) => { return (path === "/~/default") }) @@ -25,7 +25,7 @@ export class ChannelsSidebar extends Component { { return (!path.startsWith("/~/")) }) @@ -45,14 +45,18 @@ export class ChannelsSidebar extends Component { let selected = (props.selected === path); let linkCount = !!props.links[path] ? props.links[path].totalItems : 0; + const unseenCount = !!props.links[path] + ? props.links[path].unseenCount + : linkCount return ( ) }); diff --git a/pkg/interface/link/src/js/components/lib/channels-item.js b/pkg/interface/link/src/js/components/lib/channels-item.js index 4f230b3d4..9d90b143e 100644 --- a/pkg/interface/link/src/js/components/lib/channels-item.js +++ b/pkg/interface/link/src/js/components/lib/channels-item.js @@ -9,8 +9,10 @@ export class ChannelsItem extends Component { let selectedClass = (props.selected) ? "bg-gray5 bg-gray1-d b--gray4 b--gray2-d" : "b--transparent"; - - let memberCount = Object.keys(props.members).length; + + let memberCount = props.memberList + ? props.memberList.size + : 0; const unseenCount = props.unseenCount > 0 ? {" " + props.unseenCount + " unread"} : null; diff --git a/pkg/interface/link/src/js/components/lib/comment-item.js b/pkg/interface/link/src/js/components/lib/comment-item.js index d2d8fa61c..65c5b4ee3 100644 --- a/pkg/interface/link/src/js/components/lib/comment-item.js +++ b/pkg/interface/link/src/js/components/lib/comment-item.js @@ -41,7 +41,7 @@ export class CommentItem extends Component { />

- {((props.nickname) ? props.nickname : props.ship)} + {props.nickname ? props.nickname : '~'+props.ship} {this.state.timeSinceComment} diff --git a/pkg/interface/link/src/js/components/lib/comments.js b/pkg/interface/link/src/js/components/lib/comments.js index bd80497e8..c76a706b3 100644 --- a/pkg/interface/link/src/js/components/lib/comments.js +++ b/pkg/interface/link/src/js/components/lib/comments.js @@ -2,7 +2,7 @@ import React, { Component } from 'react' import { CommentItem } from './comment-item'; import { CommentsPagination } from './comments-pagination'; -import { uxToHex } from '../../lib/util'; +import { getContactDetails } from '../../lib/util'; import { api } from '../../api'; export class Comments extends Component { @@ -48,20 +48,14 @@ export class Comments extends Component { let commentObj = commentsPage[entry] let { ship, time, udon } = commentObj; - let members = !!props.members - ? props.members - : {}; + let contacts = !!props.contacts + ? props.contacts + : {}; - let nickname = !!members[ship] - ? members[ship].nickname - : ""; + const {nickname, color} = getContactDetails(contacts[ship]); let nameClass = nickname ? "inter" : "mono"; - let color = !!members[ship] - ? uxToHex(members[ship].color) - : "000000"; - return( @@ -63,7 +64,7 @@ export class Root extends Component { let groupPath = `/${props.match.params.ship}/${props.match.params.channel}`; - let groupMembers = paths[groupPath] || {}; + let contactDetails = contacts[groupPath] || {}; let page = props.match.params.page || 0; @@ -84,7 +85,7 @@ export class Root extends Component { return (