mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
chat-js: pass in groups property, convert from permissions
This commit is contained in:
parent
221238c0fa
commit
c2070dbcc6
File diff suppressed because one or more lines are too long
@ -30,7 +30,7 @@ export class InviteSearch extends Component {
|
||||
}
|
||||
|
||||
peerUpdate() {
|
||||
let groups = Array.from(Object.keys(this.props.permissions));
|
||||
let groups = Array.from(Object.keys(this.props.groups));
|
||||
groups = groups.filter(e => !e.startsWith("/~/"))
|
||||
.map(e => {
|
||||
let eachGroup = new Set();
|
||||
@ -50,16 +50,16 @@ export class InviteSearch extends Component {
|
||||
peerSet = new Set(),
|
||||
contacts = new Map;
|
||||
|
||||
Object.keys(this.props.permissions).map(group => {
|
||||
if (this.props.permissions[group].who.size > 0) {
|
||||
let groupEntries = this.props.permissions[group].who.values();
|
||||
Object.keys(this.props.groups).map(group => {
|
||||
if (this.props.groups[group].size > 0) {
|
||||
let groupEntries = this.props.groups[group].values();
|
||||
for (let member of groupEntries) {
|
||||
peerSet.add(member);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.props.contacts[group]) {
|
||||
let groupEntries = this.props.permissions[group].who.values();
|
||||
let groupEntries = this.props.groups[group].values();
|
||||
for (let member of groupEntries) {
|
||||
if (this.props.contacts[group][member]) {
|
||||
if (contacts.has(member)) {
|
||||
|
@ -216,6 +216,11 @@ export class NewScreen extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
let groups = {};
|
||||
Object.keys(props.permissions).forEach((pem) => {
|
||||
groups[pem] = props.permissions[pem].who;
|
||||
});
|
||||
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
@ -259,7 +264,7 @@ export class NewScreen extends Component {
|
||||
Selected groups or ships will be able to post to chat
|
||||
</p>
|
||||
<InviteSearch
|
||||
permissions={props.permissions}
|
||||
groups={groups}
|
||||
contacts={props.contacts}
|
||||
associations={props.associations}
|
||||
groupResults={true}
|
||||
|
Loading…
Reference in New Issue
Block a user