mirror of
https://github.com/wassname/talk.git
synced 2026-07-29 11:28:24 +08:00
lingin
This commit is contained in:
@@ -7,7 +7,6 @@ import ModerationMenu from './ModerationMenu';
|
||||
import ModerationHeader from './ModerationHeader';
|
||||
import ModerationKeysModal from '../../../components/ModerationKeysModal';
|
||||
import StorySearch from '../containers/StorySearch';
|
||||
import {isPremod} from '../../../utils';
|
||||
|
||||
export default class Moderation extends Component {
|
||||
constructor() {
|
||||
@@ -101,7 +100,7 @@ export default class Moderation extends Component {
|
||||
}
|
||||
|
||||
render () {
|
||||
const {root, moderation, settings, viewUserDetail, hideUserDetail, activeTab, getModPath, ...props} = this.props;
|
||||
const {root, moderation, settings, viewUserDetail, hideUserDetail, activeTab, getModPath, premodEnabled, ...props} = this.props;
|
||||
const assetId = this.props.params.id;
|
||||
const {asset} = root;
|
||||
|
||||
@@ -148,7 +147,7 @@ export default class Moderation extends Component {
|
||||
reportedCount={root.reportedCount}
|
||||
selectSort={this.props.setSortOrder}
|
||||
sort={this.props.moderation.sortOrder}
|
||||
premodEnabled={assetId ? isPremod(root.asset.settings.moderation) : isPremod(settings.moderation)}
|
||||
premodEnabled={premodEnabled}
|
||||
/>
|
||||
<ModerationQueue
|
||||
data={this.props.data}
|
||||
|
||||
@@ -150,19 +150,14 @@ class ModerationContainer extends Component {
|
||||
if (router.location.pathname === 'admin/moderate' && root.settings) {
|
||||
const queue = isPremod(root.settings.moderation) ? 'premod' : 'new';
|
||||
|
||||
console.log('PUSHING ROUTE', getModPath(root.reportedCount ? 'reported' : queue));
|
||||
|
||||
router.push(
|
||||
getModPath(root.reportedCount ? 'reported' : queue)
|
||||
);
|
||||
}
|
||||
|
||||
if (route.path === ':id' && root.asset) {
|
||||
console.log(root.asset.settings.moderation)
|
||||
const queue = isPremod(root.asset.settings.moderation) ? 'premod' : 'new';
|
||||
|
||||
console.log('PUSHING ROUTE', getModPath(root.reportedCount ? 'reported' : queue));
|
||||
|
||||
router.push(
|
||||
getModPath(root.reportedCount ? 'reported' : queue, router.params.id)
|
||||
);
|
||||
@@ -228,7 +223,7 @@ class ModerationContainer extends Component {
|
||||
};
|
||||
|
||||
render () {
|
||||
const {root, root: {asset}, data, params: {id: assetId}} = this.props;
|
||||
const {root, root: {asset, settings}, data, params: {id: assetId}} = this.props;
|
||||
|
||||
if (data.error) {
|
||||
return <div>Error</div>;
|
||||
@@ -258,6 +253,7 @@ class ModerationContainer extends Component {
|
||||
acceptComment={this.acceptComment}
|
||||
rejectComment={this.rejectComment}
|
||||
activeTab={this.activeTab}
|
||||
premodEnabled={assetId ? isPremod(asset.settings.moderation) : isPremod(settings.moderation)}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user