Initial changes to how trying to comment on a deleted post is handled

Этот коммит содержится в:
Reed Garmsen
2015-09-25 14:33:27 -07:00
родитель cbe1ab8dba
Коммит 16cee7f070
2 изменённых файлов: 35 добавлений и 2 удалений

Просмотреть файл

@@ -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) {