mirror of
https://github.com/urbit/shrub.git
synced 2024-12-18 15:55:00 +03:00
Merge pull request #2658 from urbit/mp/invite-search-lenience
invite search: avoid crashing with no associations
This commit is contained in:
commit
0578dc5643
@ -33,15 +33,15 @@ export class InviteSearch extends Component {
|
||||
let groups = Array.from(Object.keys(this.props.groups));
|
||||
groups = groups.filter(e => !e.startsWith("/~/"))
|
||||
.map(e => {
|
||||
let eachGroup = new Set();
|
||||
eachGroup.add(e);
|
||||
let eachGroup = [];
|
||||
eachGroup.push(e);
|
||||
if (this.props.associations) {
|
||||
let name = e;
|
||||
if (e in this.props.associations) {
|
||||
name = (this.props.associations[e].metadata.title !== "")
|
||||
? this.props.associations[e].metadata.title : e;
|
||||
}
|
||||
eachGroup.add(name);
|
||||
eachGroup.push(name);
|
||||
}
|
||||
return Array.from(eachGroup);
|
||||
});
|
||||
|
@ -31,20 +31,17 @@ export class InviteSearch extends Component {
|
||||
|
||||
peerUpdate() {
|
||||
let groups = Array.from(Object.keys(this.props.groups));
|
||||
groups = groups
|
||||
.filter(e => !e.startsWith("/~/"))
|
||||
groups = groups.filter(e => !e.startsWith("/~/"))
|
||||
.map(e => {
|
||||
let eachGroup = new Set();
|
||||
eachGroup.add(e);
|
||||
let eachGroup = [];
|
||||
eachGroup.push(e);
|
||||
if (this.props.associations) {
|
||||
let name = e;
|
||||
if (e in this.props.associations) {
|
||||
name =
|
||||
this.props.associations[e].metadata.title !== ""
|
||||
? this.props.associations[e].metadata.title
|
||||
: e;
|
||||
name = (this.props.associations[e].metadata.title !== "")
|
||||
? this.props.associations[e].metadata.title : e;
|
||||
}
|
||||
eachGroup.add(name);
|
||||
eachGroup.push(name);
|
||||
}
|
||||
return Array.from(eachGroup);
|
||||
});
|
||||
|
@ -31,20 +31,17 @@ export class InviteSearch extends Component {
|
||||
|
||||
peerUpdate() {
|
||||
let groups = Array.from(Object.keys(this.props.groups));
|
||||
groups = groups
|
||||
.filter(e => !e.startsWith("/~/"))
|
||||
groups = groups.filter(e => !e.startsWith("/~/"))
|
||||
.map(e => {
|
||||
let eachGroup = new Set();
|
||||
eachGroup.add(e);
|
||||
let eachGroup = [];
|
||||
eachGroup.push(e);
|
||||
if (this.props.associations) {
|
||||
let name = e;
|
||||
if (e in this.props.associations) {
|
||||
name =
|
||||
this.props.associations[e].metadata.title !== ""
|
||||
? this.props.associations[e].metadata.title
|
||||
: e;
|
||||
name = (this.props.associations[e].metadata.title !== "")
|
||||
? this.props.associations[e].metadata.title : e;
|
||||
}
|
||||
eachGroup.add(name);
|
||||
eachGroup.push(name);
|
||||
}
|
||||
return Array.from(eachGroup);
|
||||
});
|
||||
|
@ -31,20 +31,17 @@ export class InviteSearch extends Component {
|
||||
|
||||
peerUpdate() {
|
||||
let groups = Array.from(Object.keys(this.props.groups));
|
||||
groups = groups
|
||||
.filter(e => !e.startsWith("/~/"))
|
||||
groups = groups.filter(e => !e.startsWith("/~/"))
|
||||
.map(e => {
|
||||
let eachGroup = new Set();
|
||||
eachGroup.add(e);
|
||||
let eachGroup = [];
|
||||
eachGroup.push(e);
|
||||
if (this.props.associations) {
|
||||
let name = e;
|
||||
if (e in this.props.associations) {
|
||||
name =
|
||||
this.props.associations[e].metadata.title !== ""
|
||||
? this.props.associations[e].metadata.title
|
||||
: e;
|
||||
name = (this.props.associations[e].metadata.title !== "")
|
||||
? this.props.associations[e].metadata.title : e;
|
||||
}
|
||||
eachGroup.add(name);
|
||||
eachGroup.push(name);
|
||||
}
|
||||
return Array.from(eachGroup);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user