File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed
Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ var Actions = Reflux.createActions({
55 'login' : { } ,
66 'logout' : { } ,
77 'getNotifications' : { asyncResult : true } ,
8- 'getSettings' : { } ,
98 'setSetting' : { }
109
1110} ) ;
Original file line number Diff line number Diff line change 11var React = require ( 'react' ) ;
2- var Reflux = require ( 'reflux' ) ;
32var Toggle = require ( 'react-toggle' ) ;
43
54var Actions = require ( '../actions/actions' ) ;
65var SettingsStore = require ( '../stores/settings' ) ;
76
87var SettingsPage = React . createClass ( {
9- mixins : [
10- Reflux . connect ( SettingsStore , 'settings' )
11- ] ,
12-
138 getInitialState : function ( ) {
149 return {
15- settings : Actions . getSettings ( )
10+ participating : SettingsStore . getSettings ( ) . participating
1611 } ;
1712 } ,
1813
19- toggleParticipating : function ( ) {
20- Actions . setSetting ( 'participating' , ! this . state . settings . participating ) ;
14+ toggleParticipating : function ( event ) {
15+ Actions . setSetting ( 'participating' , event . target . checked ) ;
2116 } ,
2217
2318 render : function ( ) {
@@ -27,7 +22,7 @@ var SettingsPage = React.createClass({
2722 < div className = 'col-xs-8' > Show only participating</ div >
2823 < div className = 'col-xs-4' >
2924 < Toggle
30- defaultChecked = { this . state . settings . participating }
25+ defaultChecked = { this . state . participating }
3126 onChange = { this . toggleParticipating } />
3227 </ div >
3328 </ div >
Original file line number Diff line number Diff line change @@ -9,18 +9,18 @@ var SettingsStore = Reflux.createStore({
99
1010 if ( ! settings ) {
1111 settings = {
12- 'participating' : true
12+ 'participating' : false
1313 } ;
1414 }
1515
16- if ( settings [ 0 ] === "{" ) {
16+ if ( settings [ 0 ] === '{' ) {
1717 settings = JSON . parse ( settings ) ;
1818 }
1919
2020 this . _settings = settings ;
2121 } ,
2222
23- onGetSettings : function ( ) {
23+ getSettings : function ( ) {
2424 return this . _settings ;
2525 } ,
2626
You can’t perform that action at this time.
0 commit comments