File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,22 +90,16 @@ const server = patternlab => {
9090 return new Promise ( ( resolve , reject ) => {
9191 let action ;
9292 try {
93- const reloadInterval = setInterval ( ( ) => {
94- if ( ! patternlab . isBusy ) {
95- if (
96- _data . file . indexOf ( 'css' ) > - 1 ||
97- _data . action === 'refresh'
98- ) {
99- action = 'refreshed CSS' ;
100- liveServer . refreshCSS ( ) ;
101- } else {
102- action = 'reloaded' ;
103- liveServer . reload ( ) ;
104- }
105- clearInterval ( reloadInterval ) ;
106- resolve ( `Server ${ action } successfully` ) ;
93+ if ( ! patternlab . isBusy ) {
94+ if ( _data . file . indexOf ( 'css' ) > - 1 || _data . action === 'refresh' ) {
95+ action = 'refreshed CSS' ;
96+ liveServer . refreshCSS ( ) ;
97+ } else {
98+ action = 'reloaded' ;
99+ liveServer . reload ( ) ;
107100 }
108- } , 1000 ) ;
101+ resolve ( `Server ${ action } successfully` ) ;
102+ }
109103 } catch ( e ) {
110104 reject ( `Server reload or refresh failed: ${ e } ` ) ;
111105 }
You can’t perform that action at this time.
0 commit comments