File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,16 @@ if (_isServiceWorkerLoaderPage() && 'serviceWorker' in navigator) {
108108 logger . leaveTrail ( `Service worker loader: refresh cache updatedFilesCount: ` + updatedFilesCount ) ;
109109 window . Phoenix . cache . updatePendingReloadReason = "refreshCache" ;
110110 window . Phoenix . cache . updatedFilesCount = updatedFilesCount || 0 ;
111+ if ( updatedFilesCount ) {
112+ let lessRefreshInterval = setInterval ( ( ) => {
113+ // wait for less to get loaded. less caches css in local storage in production urls
114+ // and might not load new css classes if we don't reset. less doesn't cache in localhost.
115+ if ( window . less && window . less . refresh ) {
116+ window . less . refresh ( true ) ;
117+ clearInterval ( lessRefreshInterval ) ;
118+ }
119+ } , 500 ) ;
120+ }
111121 if ( doneCB ) {
112122 doneCB ( ) ;
113123 }
You can’t perform that action at this time.
0 commit comments