File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ var SettingsPage = React.createClass({
13
13
} ;
14
14
} ,
15
15
16
- toggleParticipating : function ( event ) {
17
- Actions . setSetting ( 'participating' , event . target . checked ) ;
16
+ toggleSetting : function ( key , event ) {
17
+ Actions . setSetting ( key , event . target . checked ) ;
18
18
} ,
19
19
20
20
appQuit : function ( ) {
@@ -29,7 +29,15 @@ var SettingsPage = React.createClass({
29
29
< div className = 'col-xs-4' >
30
30
< Toggle
31
31
defaultChecked = { this . state . participating }
32
- onChange = { this . toggleParticipating } />
32
+ onChange = { this . toggleSetting . bind ( this , 'participating' ) } />
33
+ </ div >
34
+ </ div >
35
+ < div className = 'row' >
36
+ < div className = 'col-xs-8' > Play sound</ div >
37
+ < div className = 'col-xs-4' >
38
+ < Toggle
39
+ defaultChecked = { this . state . participating }
40
+ onChange = { this . toggleSetting . bind ( this , 'play-sound' ) } />
33
41
</ div >
34
42
</ div >
35
43
< div className = 'row' >
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ var NotificationsStore = Reflux.createStore({
49
49
onGetNotifications : function ( ) {
50
50
var self = this ;
51
51
var participating = SettingsStore . getSettings ( ) . participating ;
52
+ var playSound = SettingsStore . getSettings ( ) . playSound ;
52
53
53
54
apiRequests
54
55
. getAuth ( 'https://api.github.com/notifications?participating=' +
@@ -58,7 +59,10 @@ var NotificationsStore = Reflux.createStore({
58
59
// Success - Do Something.
59
60
Actions . getNotifications . completed ( response . body ) ;
60
61
self . updateTrayIcon ( response . body ) ;
61
- self . isNewNotification ( response . body ) ;
62
+
63
+ if ( playSound ) {
64
+ self . isNewNotification ( response . body ) ;
65
+ }
62
66
} else {
63
67
// Error - Show messages.
64
68
Actions . getNotifications . failed ( err ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ var SettingsStore = Reflux.createStore({
9
9
10
10
if ( ! settings ) {
11
11
settings = {
12
- 'participating' : false
12
+ 'participating' : false ,
13
+ 'playSound' : true
13
14
} ;
14
15
}
15
16
You can’t perform that action at this time.
0 commit comments