publish: fixed error on notebook refresh

fixed #3506
This commit is contained in:
Tyler Brown Cifu Shuster 2020-09-18 19:50:53 -07:00
parent c19acbb041
commit 46afe8abe6

View File

@ -59,8 +59,10 @@ export class Notebook extends PureComponent<NotebookProps & RouteComponentProps,
render() {
const { api, ship, book, notebook, notebookContacts, groups, history, hideNicknames, associations } = this.props;
const contact = notebookContacts[ship];
const group = groups[notebook?.["writers-group-path"]];
if (!group) return null; // Waitin on groups to populate
const contact = notebookContacts[ship];
const role = group ? roleForShip(group, window.ship) : undefined;
const isOwn = `~${window.ship}` === ship;
const isAdmin = role === "admin" || isOwn;