File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ var SettingsPage = React.createClass({
1919 } ,
2020
2121 toggleParticipating : function ( ) {
22- Actions . setSetting ( 'participating' , 'true' ) ;
22+ Actions . setSetting ( 'participating' , ! this . state . settings . participating ) ;
2323 } ,
2424
2525 render : function ( ) {
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ var SettingsStore = Reflux.createStore({
88 var settings = window . localStorage . getItem ( 'settings' ) || {
99 participating : false
1010 } ;
11- var participatingSetting = settings . participating || false ;
11+ var participatingSetting = settings . participating ;
1212 this . _settings = {
1313 participating : participatingSetting
1414 } ;
@@ -20,6 +20,9 @@ var SettingsStore = Reflux.createStore({
2020
2121 onSetSetting : function ( setting , value ) {
2222 console . log ( 'Setting: ' + setting + ' to: ' + value ) ;
23+ window . localStorage . setItem ( 'settings' , this . _settings ) ;
24+ this . _settings . participating = value ;
25+ this . trigger ( this . _settings ) ;
2326 }
2427
2528} ) ;
You can’t perform that action at this time.
0 commit comments