Initial changes to how trying to comment on a deleted post is handled
Этот коммит содержится в:
@@ -2,13 +2,38 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
var UserStore = require('../stores/user_store.jsx');
|
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 {
|
export default class PostDeletedModal extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
|
this.handleClose = this.handleClose.bind(this);
|
||||||
|
|
||||||
this.state = {};
|
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() {
|
render() {
|
||||||
var currentUser = UserStore.getCurrentUser();
|
var currentUser = UserStore.getCurrentUser();
|
||||||
|
|
||||||
@@ -37,17 +62,18 @@ export default class PostDeletedModal extends React.Component {
|
|||||||
className='modal-title'
|
className='modal-title'
|
||||||
id='myModalLabel'
|
id='myModalLabel'
|
||||||
>
|
>
|
||||||
Comment could not be posted
|
Post deleted
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div className='modal-body'>
|
<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>
|
||||||
<div className='modal-footer'>
|
<div className='modal-footer'>
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
className='btn btn-primary'
|
className='btn btn-primary'
|
||||||
data-dismiss='modal'
|
data-dismiss='modal'
|
||||||
|
onClick={this.handleClose}
|
||||||
>
|
>
|
||||||
Okay
|
Okay
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -71,6 +71,13 @@ export default class RhsThread extends React.Component {
|
|||||||
return;
|
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);
|
var currentPosts = PostStore.getPosts(currentSelected.posts[currentSelected.order[0]].channel_id);
|
||||||
|
|
||||||
if (!currentPosts || currentPosts.order.length === 0) {
|
if (!currentPosts || currentPosts.order.length === 0) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user