summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_deleted_modal.jsx
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-10-05 16:47:17 -0700
committerReed Garmsen <rgarmsen2295@gmail.com>2015-10-07 13:00:16 -0700
commitbe8225b761a3009efd1097a0b4dd4d8f44830a33 (patch)
tree7ec315e83228a16a9b3bdb316744dd956a4b9c61 /web/react/components/post_deleted_modal.jsx
parent16cee7f0702e7c18d131f0a30c0ba837abcc2a0c (diff)
downloadchat-be8225b761a3009efd1097a0b4dd4d8f44830a33.tar.gz
chat-be8225b761a3009efd1097a0b4dd4d8f44830a33.tar.bz2
chat-be8225b761a3009efd1097a0b4dd4d8f44830a33.zip
Now handles commenting on a deleted post gracefully, and checks for any areas where data may no longer exist once a post has been deleted
Diffstat (limited to 'web/react/components/post_deleted_modal.jsx')
-rw-r--r--web/react/components/post_deleted_modal.jsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/web/react/components/post_deleted_modal.jsx b/web/react/components/post_deleted_modal.jsx
index 024097428..3f487d20f 100644
--- a/web/react/components/post_deleted_modal.jsx
+++ b/web/react/components/post_deleted_modal.jsx
@@ -14,9 +14,12 @@ export default class PostDeletedModal extends React.Component {
this.state = {};
}
- handleClose(e) {
- e.preventDefault();
-
+ componentDidMount() {
+ $(React.findDOMNode(this.refs.modal)).on('hidden.bs.modal', () => {
+ this.handleClose();
+ });
+ }
+ handleClose() {
AppDispatcher.handleServerAction({
type: ActionTypes.RECIEVED_SEARCH,
results: null
@@ -56,26 +59,25 @@ export default class PostDeletedModal extends React.Component {
data-dismiss='modal'
aria-label='Close'
>
- <span aria-hidden='true'>&times;</span>
+ <span aria-hidden='true'>{'×'}</span>
</button>
<h4
className='modal-title'
id='myModalLabel'
>
- Post deleted
+ {'Comment could not be posted'}
</h4>
</div>
<div className='modal-body'>
- <p>The post you were viewing was deleted by the owner.</p>
+ <p>{'Someone deleted the message on which you tried to post a comment.'}</p>
</div>
<div className='modal-footer'>
<button
type='button'
className='btn btn-primary'
data-dismiss='modal'
- onClick={this.handleClose}
>
- Okay
+ {'Okay'}
</button>
</div>
</div>