PLT-74: Enable Up Arrow keyboard shortcut to edit your last message
- fix bug where channel_id was not set if update_post ajax was "too fast" - fix bug js error if there is no last post, i.e. empty channel - renamed lastPostId to postId so it has a nicer api to be triggered from everywhere - fix a typo - automatically focus textarea on modal open
Этот коммит содержится в:
@@ -300,14 +300,17 @@ export default class CreatePost extends React.Component {
|
||||
|
||||
const channelId = ChannelStore.getCurrentId();
|
||||
const lastPost = PostStore.getCurrentUsersLatestPost(channelId);
|
||||
if (!lastPost) {
|
||||
return;
|
||||
}
|
||||
var type = (lastPost.root_id && lastPost.root_id.length > 0) ? 'Comment' : 'Post';
|
||||
|
||||
AppDispatcher.handleViewAction({
|
||||
type: ActionTypes.RECIEVED_EDIT_POST,
|
||||
refoucsId: '#post_textbox',
|
||||
refocusId: '#post_textbox',
|
||||
title: type,
|
||||
message: lastPost.message,
|
||||
lastPostId: lastPost.id,
|
||||
postId: lastPost.id,
|
||||
channelId: lastPost.channel_id
|
||||
});
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user