mirror of
https://github.com/wassname/talk.git
synced 2026-07-01 09:28:35 +08:00
Safe access
This commit is contained in:
@@ -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 &&
|
||||
|
||||
@@ -36,6 +36,7 @@ module.exports = {
|
||||
|
||||
adminPage
|
||||
.openDrawer()
|
||||
.goToCommunity();
|
||||
.goToCommunity();
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
@@ -17,6 +17,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
'creates a new asset': (client) => {
|
||||
|
||||
const asset = 'newAssetTest';
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user