Skip to content

Commit 7363f21

Browse files
committed
Refresh comment list immediately; Increase poll interval to 5s
1 parent 73e190e commit 7363f21

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

client/assets/javascripts/App.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $(function onLoad() {
77
if ($('#content').length > 0) {
88
React.render(
99
<div>
10-
<CommentBox url='comments.json' pollInterval={2000}/>
10+
<CommentBox url='comments.json' pollInterval={5000}/>
1111

1212
<div className='container'>
1313
<a href='http://www.railsonmaui.com'>

client/assets/javascripts/stores/CommentStore.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class CommentStore {
99
this.bindListeners({
1010
handleFetchComments: CommentActions.FETCH_COMMENTS,
1111
handleUpdateComments: CommentActions.UPDATE_COMMENTS,
12-
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR
12+
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR,
13+
handleAddComment: CommentActions.ADD_COMMENT
1314
});
1415
}
1516

client/assets/javascripts/stores/FormStore.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class FormStore {
1414
handleSubmitComment: FormActions.SUBMIT_COMMENT,
1515
handleFetchComments: CommentActions.FETCH_COMMENTS,
1616
handleUpdateComments: CommentActions.UPDATE_COMMENTS,
17-
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR
17+
handleUpdateCommentsError: CommentActions.UPDATE_COMMENTS_ERROR,
18+
handleAddComment: CommentActions.ADD_COMMENT
1819
});
1920
}
2021

@@ -40,6 +41,10 @@ class FormStore {
4041
handleUpdateCommentsError() {
4142
this.ajaxSending = false;
4243
}
44+
45+
handleAddComment() {
46+
this.ajaxSending = false;
47+
}
4348
}
4449

4550
export default alt.createStore(FormStore, 'FormStore');

0 commit comments

Comments
 (0)