Safe access

This commit is contained in:
Belen Curcio
2017-11-20 00:38:52 -03:00
parent 7ec239fd68
commit 8f12fcd09b
4 changed files with 6 additions and 4 deletions
@@ -55,7 +55,6 @@ class User extends React.Component {
className={styles.button}>
{user.username}
</button>
{console.log(user.status.banned.status, user)}
{me.id !== user.id &&
<ActionsMenu icon="not_interested">
<ActionsMenuItem
@@ -15,6 +15,7 @@ import QuestionBox from 'talk-plugin-questionbox/QuestionBox';
import {isCommentActive} from 'coral-framework/utils';
import {Button, Tab, TabCount, TabPane} from 'coral-ui';
import cn from 'classnames';
import get from 'lodash/get';
import {getTopLevelParent, attachCommentToParent} from '../graphql/utils';
import AllCommentsPane from './AllCommentsPane';
@@ -212,8 +213,8 @@ class Stream extends React.Component {
const {keepCommentBox} = this.state;
const open = !asset.isClosed;
const banned = user && user.status.banned.status;
const pending = user && user.status.username.status === 'CHANGED' || user.status.username.status === 'SET';
const banned = get(user, 'status.banned.status');
const pending = get(user, 'status.username.status') === 'CHANGED' || get(user, 'status.username.status') === 'SET';
const temporarilySuspended =
user &&
+2 -1
View File
@@ -36,6 +36,7 @@ module.exports = {
adminPage
.openDrawer()
.goToCommunity();
.goToCommunity();
},
};
+1
View File
@@ -17,6 +17,7 @@ module.exports = {
},
'creates a new asset': (client) => {
const asset = 'newAssetTest';
const embedStream = client.page.embedStream();