summaryrefslogtreecommitdiffstats
path: root/webapp/components/post_view/post_focus_view_controller.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-08-04 11:38:09 -0400
committerenahum <nahumhbl@gmail.com>2016-08-04 10:38:09 -0500
commit0184d6059bb1943fb74bf33d1d200a423c5bf5e6 (patch)
tree4b8480d65d5ec181b372a09f946bb7649809a467 /webapp/components/post_view/post_focus_view_controller.jsx
parent9b50b5028391ee29922ad5549b785ac2312be368 (diff)
downloadchat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.gz
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.tar.bz2
chat-0184d6059bb1943fb74bf33d1d200a423c5bf5e6.zip
PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality * UI Improvements to flags (#3697) * Added flag functionality for mobile * Updating flagged text (#3699) * Add back button to RHS thread when coming from flagged posts * Updating position of flags (#3708) * Plt 3506 - Reverting flag position (#3724) * Revert "Updating position of flags (#3708)" This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58. * Fixing the icon in search * Help text and white space improvements (#3730) * Updatng help text and some white spacing. * Updating help text
Diffstat (limited to 'webapp/components/post_view/post_focus_view_controller.jsx')
-rw-r--r--webapp/components/post_view/post_focus_view_controller.jsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/webapp/components/post_view/post_focus_view_controller.jsx b/webapp/components/post_view/post_focus_view_controller.jsx
index f8738e056..4a7d312f5 100644
--- a/webapp/components/post_view/post_focus_view_controller.jsx
+++ b/webapp/components/post_view/post_focus_view_controller.jsx
@@ -8,6 +8,7 @@ import EmojiStore from 'stores/emoji_store.jsx';
import PostStore from 'stores/post_store.jsx';
import UserStore from 'stores/user_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
+import PreferenceStore from 'stores/preference_store.jsx';
import Constants from 'utils/constants.jsx';
const ScrollTypes = Constants.ScrollTypes;
@@ -22,6 +23,7 @@ export default class PostFocusView extends React.Component {
this.onPostsChange = this.onPostsChange.bind(this);
this.onUserChange = this.onUserChange.bind(this);
this.onEmojiChange = this.onEmojiChange.bind(this);
+ this.onPreferenceChange = this.onPreferenceChange.bind(this);
this.onPostListScroll = this.onPostListScroll.bind(this);
const focusedPostId = PostStore.getFocusedPostId();
@@ -41,7 +43,8 @@ export default class PostFocusView extends React.Component {
scrollPostId: focusedPostId,
atTop: PostStore.getVisibilityAtTop(focusedPostId),
atBottom: PostStore.getVisibilityAtBottom(focusedPostId),
- emojis: EmojiStore.getEmojis()
+ emojis: EmojiStore.getEmojis(),
+ flaggedPosts: PreferenceStore.getCategory(Constants.Preferences.CATEGORY_FLAGGED_POST)
};
}
@@ -50,6 +53,7 @@ export default class PostFocusView extends React.Component {
PostStore.addChangeListener(this.onPostsChange);
UserStore.addChangeListener(this.onUserChange);
EmojiStore.addChangeListener(this.onEmojiChange);
+ PreferenceStore.addChangeListener(this.onPreferenceChange);
}
componentWillUnmount() {
@@ -98,6 +102,12 @@ export default class PostFocusView extends React.Component {
});
}
+ onPreferenceChange() {
+ this.setState({
+ flaggedPosts: PreferenceStore.getCategory(Constants.Preferences.CATEGORY_FLAGGED_POST)
+ });
+ }
+
onPostListScroll() {
this.setState({scrollType: ScrollTypes.FREE});
}
@@ -128,6 +138,7 @@ export default class PostFocusView extends React.Component {
postsToHighlight={postsToHighlight}
isFocusPost={true}
emojis={this.state.emojis}
+ flaggedPosts={this.state.flaggedPosts}
/>
);
}