Show flagged posts consistently throughout the UI (#7063)

Этот коммит содержится в:
Joram Wilander
2017-08-01 09:04:28 -04:00
коммит произвёл Harrison Healey
родитель 0331409488
Коммит 4ef844298f
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux'; import {bindActionCreators} from 'redux';
import {removePost, addReaction} from 'mattermost-redux/actions/posts'; import {removePost, addReaction} from 'mattermost-redux/actions/posts';
import {getBool} from 'mattermost-redux/selectors/entities/preferences'; import {get, getBool} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'utils/constants.jsx'; import {Preferences} from 'utils/constants.jsx';
@@ -15,7 +15,7 @@ function mapStateToProps(state, ownProps) {
return { return {
...ownProps, ...ownProps,
useMilitaryTime: getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.USE_MILITARY_TIME, false), useMilitaryTime: getBool(state, Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.USE_MILITARY_TIME, false),
isFlagged: getBool(state, Preferences.CATEGORY_FLAGGED_POST, ownProps.post.id) isFlagged: get(state, Preferences.CATEGORY_FLAGGED_POST, ownProps.post.id, null) != null
}; };
} }

Просмотреть файл

@@ -343,7 +343,7 @@ export default class RhsThread extends React.Component {
let isRootFlagged = false; let isRootFlagged = false;
if (this.state.flaggedPosts) { if (this.state.flaggedPosts) {
isRootFlagged = this.state.flaggedPosts.get(selected.id) === 'true'; isRootFlagged = this.state.flaggedPosts.get(selected.id) != null;
} }
let rootStatus = 'offline'; let rootStatus = 'offline';
@@ -367,7 +367,7 @@ export default class RhsThread extends React.Component {
let isFlagged = false; let isFlagged = false;
if (this.state.flaggedPosts) { if (this.state.flaggedPosts) {
isFlagged = this.state.flaggedPosts.get(comPost.id) === 'true'; isFlagged = this.state.flaggedPosts.get(comPost.id) != null;
} }
let status = 'offline'; let status = 'offline';

Просмотреть файл

@@ -284,7 +284,7 @@ export default class SearchResults extends React.Component {
let isFlagged = false; let isFlagged = false;
if (this.state.flaggedPosts) { if (this.state.flaggedPosts) {
isFlagged = this.state.flaggedPosts.get(post.id) === 'true'; isFlagged = this.state.flaggedPosts.get(post.id) != null;
} }
const reverseCount = arr.length - idx - 1; const reverseCount = arr.length - idx - 1;