summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-09-25 14:33:27 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-10-06 09:19:26 -0700
commit16cee7f0702e7c18d131f0a30c0ba837abcc2a0c (patch)
treed7610010634d334a904e52e62f89572b8910acb8 /web
parentcbe1ab8dbac9502017a5ae5cd4eb01d9c43772e2 (diff)
downloadchat-16cee7f0702e7c18d131f0a30c0ba837abcc2a0c.tar.gz
chat-16cee7f0702e7c18d131f0a30c0ba837abcc2a0c.tar.bz2
chat-16cee7f0702e7c18d131f0a30c0ba837abcc2a0c.zip
Initial changes to how trying to comment on a deleted post is handled
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_deleted_modal.jsx30
-rw-r--r--web/react/components/rhs_thread.jsx7
2 files changed, 35 insertions, 2 deletions
diff --git a/web/react/components/post_deleted_modal.jsx b/web/react/components/post_deleted_modal.jsx
index d284a9d1b..024097428 100644
--- a/web/react/components/post_deleted_modal.jsx
+++ b/web/react/components/post_deleted_modal.jsx
@@ -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>
diff --git a/web/react/components/rhs_thread.jsx b/web/react/components/rhs_thread.jsx
index 2f23d80d9..fdcf618d7 100644
--- a/web/react/components/rhs_thread.jsx
+++ b/web/react/components/rhs_thread.jsx
@@ -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) {