Initial changes to how trying to comment on a deleted post is handled
Этот коммит содержится в:
@@ -2,13 +2,38 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
var ActionTypes = Constants.ActionTypes;
|
||||
|
||||
export default class PostDeletedModal extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.handleClose = this.handleClose.bind(this);
|
||||
|
||||
this.state = {};
|
||||
}
|
||||
handleClose(e) {
|
||||
e.preventDefault();
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_SEARCH,
|
||||
results: null
|
||||
});
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_SEARCH_TERM,
|
||||
term: null,
|
||||
do_search: false,
|
||||
is_mention_search: false
|
||||
});
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECIEVED_POST_SELECTED,
|
||||
results: null
|
||||
});
|
||||
}
|
||||
render() {
|
||||
var currentUser = UserStore.getCurrentUser();
|
||||
|
||||
@@ -37,17 +62,18 @@ export default class PostDeletedModal extends React.Component {
|
||||
className='modal-title'
|
||||
id='myModalLabel'
|
||||
>
|
||||
Comment could not be posted
|
||||
Post deleted
|
||||
</h4>
|
||||
</div>
|
||||
<div className='modal-body'>
|
||||
<p>Someone deleted the message on which you tried to post a comment.</p>
|
||||
<p>The post you were viewing was deleted by the owner.</p>
|
||||
</div>
|
||||
<div className='modal-footer'>
|
||||
<button
|
||||
type='button'
|
||||
className='btn btn-primary'
|
||||
data-dismiss='modal'
|
||||
onClick={this.handleClose}
|
||||
>
|
||||
Okay
|
||||
</button>
|
||||
|
||||
@@ -71,6 +71,13 @@ export default class RhsThread extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentSelected.posts[currentSelected.order[0]]) {
|
||||
if ($('#post_deleted').length > 0) {
|
||||
$('#post_deleted').modal('show');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var currentPosts = PostStore.getPosts(currentSelected.posts[currentSelected.order[0]].channel_id);
|
||||
|
||||
if (!currentPosts || currentPosts.order.length === 0) {
|
||||
|
||||
Ссылка в новой задаче
Block a user