mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-1909 Fixed error rendering pending posts (#3041)
* Fixed error caused by checking if a post is a system message * Fixed trying to edit system posts when using the up arrow hotkey
This commit is contained in:
committed by
Christopher Speller
parent
d48be63513
commit
02576f3d59
@@ -33,7 +33,7 @@ export default class PostInfo extends React.Component {
|
||||
var post = this.props.post;
|
||||
var isOwner = this.props.currentUser.id === post.user_id;
|
||||
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
|
||||
if (post.state === Constants.POST_FAILED || post.state === Constants.POST_LOADING || Utils.isPostEphemeral(post)) {
|
||||
return '';
|
||||
|
||||
@@ -85,7 +85,7 @@ export default class RhsComment extends React.Component {
|
||||
|
||||
const isOwner = this.props.currentUser.id === post.user_id;
|
||||
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
|
||||
var dropdownContents = [];
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export default class RhsRootPost extends React.Component {
|
||||
const user = this.props.user;
|
||||
var isOwner = this.props.currentUser.id === post.user_id;
|
||||
var isAdmin = TeamStore.isTeamAdminForCurrentTeam() || UserStore.isSystemAdminForCurrentUser();
|
||||
const isSystemMessage = post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
const isSystemMessage = post.type && post.type.startsWith(Constants.SYSTEM_MESSAGE_PREFIX);
|
||||
var timestamp = UserStore.getProfile(post.user_id).update_at;
|
||||
var channel = ChannelStore.get(post.channel_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user