summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-08-01 09:04:28 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2017-08-01 09:04:28 -0400
commit4ef844298fdb0d6fb41eac760f8ac00cee82b3bc (patch)
tree80fbe9c2ab194408ed1417910d1e13fac325569a
parent0331409488083a58d66fdf58eb22cbaa924237f6 (diff)
downloadchat-4ef844298fdb0d6fb41eac760f8ac00cee82b3bc.tar.gz
chat-4ef844298fdb0d6fb41eac760f8ac00cee82b3bc.tar.bz2
chat-4ef844298fdb0d6fb41eac760f8ac00cee82b3bc.zip
Show flagged posts consistently throughout the UI (#7063)
-rw-r--r--webapp/components/post_view/post_info/index.js4
-rw-r--r--webapp/components/rhs_thread/rhs_thread.jsx4
-rw-r--r--webapp/components/search_results.jsx2
3 files changed, 5 insertions, 5 deletions
diff --git a/webapp/components/post_view/post_info/index.js b/webapp/components/post_view/post_info/index.js
index 749ec5aba..041080da8 100644
--- a/webapp/components/post_view/post_info/index.js
+++ b/webapp/components/post_view/post_info/index.js
@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
import {bindActionCreators} from 'redux';
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';
@@ -15,7 +15,7 @@ function mapStateToProps(state, ownProps) {
return {
...ownProps,
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
};
}
diff --git a/webapp/components/rhs_thread/rhs_thread.jsx b/webapp/components/rhs_thread/rhs_thread.jsx
index 58325e8cc..73e426207 100644
--- a/webapp/components/rhs_thread/rhs_thread.jsx
+++ b/webapp/components/rhs_thread/rhs_thread.jsx
@@ -343,7 +343,7 @@ export default class RhsThread extends React.Component {
let isRootFlagged = false;
if (this.state.flaggedPosts) {
- isRootFlagged = this.state.flaggedPosts.get(selected.id) === 'true';
+ isRootFlagged = this.state.flaggedPosts.get(selected.id) != null;
}
let rootStatus = 'offline';
@@ -367,7 +367,7 @@ export default class RhsThread extends React.Component {
let isFlagged = false;
if (this.state.flaggedPosts) {
- isFlagged = this.state.flaggedPosts.get(comPost.id) === 'true';
+ isFlagged = this.state.flaggedPosts.get(comPost.id) != null;
}
let status = 'offline';
diff --git a/webapp/components/search_results.jsx b/webapp/components/search_results.jsx
index 6244fa85a..1d1627950 100644
--- a/webapp/components/search_results.jsx
+++ b/webapp/components/search_results.jsx
@@ -284,7 +284,7 @@ export default class SearchResults extends React.Component {
let isFlagged = false;
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;