Merge pull request #2394 from urbit/mp/os1/chat/contact-polling

chat: pull room contacts from associated group
This commit is contained in:
Logan 2020-03-03 18:33:20 -08:00 committed by GitHub
commit f457c0e568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,12 +45,13 @@ export class Root extends Component {
state.invites['/chat'] : {};
let contacts = !!state.contacts ? state.contacts : {};
let associations = !!state.associations ? state.associations : new Map;
const renderChannelSidebar = (props, station) => (
<Sidebar
inbox={state.inbox}
messagePreviews={messagePreviews}
associations={state.associations || new Map}
associations={associations}
contacts={contacts}
invites={invites}
unreads={unreads}
@ -152,8 +153,14 @@ export class Root extends Component {
envelopes: []
};
let roomContacts = (station in contacts)
? contacts[station] : {};
let roomContacts = {};
let associatedGroup = ((associations.has(station)) &&
(associations.get(station)["group-path"]))
? associations.get(station)["group-path"] : "";
if ((associations.has(station)) && (associatedGroup in contacts)) {
roomContacts = contacts[associatedGroup]
}
let group = state.groups[station] || new Set([]);
let popout = props.match.url.includes("/popout/");
@ -240,9 +247,8 @@ export class Root extends Component {
let popout = props.match.url.includes("/popout/");
let association = ((state.associations) &&
(state.associations.has(station)))
? state.associations.get(station) : {};
let association = (associations.has(station))
? associations.get(station) : {};
return (
<Skeleton