@@ -5,65 +5,66 @@ var _alert = {
55open :false ,
66action :'' ,
77} ;
8+ var open = {
9+ open :true ,
10+ pass :true ,
11+ } ;
812var current = _alert ;
913function alertReducer ( alert , action ) {
1014if ( alert === void 0 ) { alert = _alert ; }
1115var statusBarAlert = document . getElementsByClassName ( 'cr-alert-replay' ) [ 0 ] ;
1216switch ( action . type ) {
1317case _types_1 . ALERT_REPLAY :
14- return Object . assign ( { } , current , { open : true } ) ;
18+ return Object . assign ( { } , current , open ) ;
1519case _types_1 . ALERT_TOGGLE :
1620return action . payload . alert || _alert ;
21+ case _types_1 . TUTORIAL_UPDATE :
22+ current = Object . assign ( { } , {
23+ message :"run `npm install --save-dev " + action . payload . name + "`" ,
24+ action :'note' ,
25+ duration :4000 ,
26+ } , open ) ;
27+ return current ;
1728case _types_1 . TEST_RESULT :
1829var result = action . payload . result ;
1930if ( result . pass && result . change > 0 ) {
2031statusBarAlert . style . color = '#73C990' ;
21- current = {
32+ current = Object . assign ( { } , {
2233message :result . msg ,
23- open :true ,
24- action :'pass' ,
2534duration :result . duration || 1500 ,
26- } ;
35+ } , open ) ;
2736return current ;
2837}
2938else if ( result . pass === false && result . change < 1 ) {
3039statusBarAlert . style . color = '#FF4081' ;
31- current = {
40+ current = Object . assign ( { } , {
3241message :result . msg ,
33- open :true ,
3442action :'fail' ,
3543duration :result . duration || 2500 ,
36- } ;
44+ } , open ) ;
3745return current ;
3846}
3947statusBarAlert . style . color = '#9DA5B4' ;
40- current = {
48+ current = Object . assign ( { } , {
4149message :result . msg ,
42- open :true ,
4350action :'note' ,
4451duration :result . duration || 2500 ,
45- } ;
52+ } , open ) ;
4653return current ;
4754case _types_1 . COMPLETE_PAGE :
48- current = {
55+ current = Object . assign ( { } , {
4956message :"Page " + ( action . payload . position . page + 1 ) + " Complete" ,
50- open :true ,
51- action :'pass' ,
52- } ;
57+ } , open ) ;
5358return current ;
5459case _types_1 . COMPLETE_CHAPTER :
55- current = {
60+ current = Object . assign ( { } , {
5661message :"Chapter " + ( action . payload . chapter + 1 ) + " Complete" ,
57- open :true ,
58- action :'pass' ,
59- } ;
62+ } , open ) ;
6063return current ;
6164case _types_1 . COMPLETE_TUTORIAL :
62- current = {
65+ current = Object . assign ( { } , {
6366message :'Tutorial Complete' ,
64- open :true ,
65- action :'pass' ,
66- } ;
67+ } , open ) ;
6768return current ;
6869default :
6970return alert ;