Sort pinned posts from newest to oldest (#2440)

* Sort pinned posts from newest to oldest

* Update mattermost-redux
This commit is contained in:
Elias Nahum 2018-12-07 15:56:19 -03:00
parent 852227684b
commit a85a3bf5d9
No known key found for this signature in database
GPG key ID: E038DB71E0B61702
4 changed files with 8 additions and 4 deletions

View file

@ -27,6 +27,7 @@ import ChannelInfoRow from './channel_info_row';
export default class ChannelInfo extends PureComponent {
static propTypes = {
actions: PropTypes.shape({
clearPinnedPosts: PropTypes.func.isRequired,
closeDMChannel: PropTypes.func.isRequired,
closeGMChannel: PropTypes.func.isRequired,
deleteChannel: PropTypes.func.isRequired,
@ -144,10 +145,11 @@ export default class ChannelInfo extends PureComponent {
goToPinnedPosts = preventDoubleTap(() => {
const {formatMessage} = this.context.intl;
const {currentChannel, navigator, theme} = this.props;
const {actions, currentChannel, navigator, theme} = this.props;
const id = t('channel_header.pinnedPosts');
const defaultMessage = 'Pinned Posts';
actions.clearPinnedPosts(currentChannel.id);
navigator.push({
backButtonTitle: '',
screen: 'PinnedPosts',

View file

@ -14,6 +14,7 @@ import {
} from 'mattermost-redux/actions/channels';
import {getCustomEmojisInText} from 'mattermost-redux/actions/emojis';
import {selectFocusedPostId} from 'mattermost-redux/actions/posts';
import {clearPinnedPosts} from 'mattermost-redux/actions/search';
import {General} from 'mattermost-redux/constants';
import {getTheme} from 'mattermost-redux/selectors/entities/preferences';
import {
@ -90,6 +91,7 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({
clearPinnedPosts,
closeDMChannel,
closeGMChannel,
deleteChannel,

4
package-lock.json generated
View file

@ -8376,8 +8376,8 @@
"integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w="
},
"mattermost-redux": {
"version": "github:mattermost/mattermost-redux#b730595c859e61ebc04806967f2df27c60f0050a",
"from": "github:mattermost/mattermost-redux#b730595c859e61ebc04806967f2df27c60f0050a",
"version": "github:mattermost/mattermost-redux#9d9f430f46658cf9c84459cb8cca9efe632d165a",
"from": "github:mattermost/mattermost-redux#9d9f430f46658cf9c84459cb8cca9efe632d165a",
"requires": {
"deep-equal": "1.0.1",
"eslint-plugin-header": "1.2.0",

View file

@ -17,7 +17,7 @@
"intl": "1.2.5",
"jail-monkey": "1.0.0",
"jsc-android": "236355.1.0",
"mattermost-redux": "github:mattermost/mattermost-redux#b730595c859e61ebc04806967f2df27c60f0050a",
"mattermost-redux": "github:mattermost/mattermost-redux#9d9f430f46658cf9c84459cb8cca9efe632d165a",
"mime-db": "1.37.0",
"moment-timezone": "0.5.23",
"prop-types": "15.6.2",