File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11import 'src/styles/index.scss' ;
22
3+ import { Button } from '@blueprintjs/core' ;
34import * as Sentry from '@sentry/browser' ;
45import { setModulesStaticURL } from 'js-slang/dist/modules/moduleLoader' ;
56import { createRoot } from 'react-dom/client' ;
@@ -47,9 +48,21 @@ createInBrowserFileSystem(store)
4748 } ) ;
4849
4950registerServiceWorker ( {
50- onUpdate : ( ) => {
51+ onUpdate : registration => {
5152 showWarningMessage (
52- 'A new version of Source Academy is available. Please refresh the browser.' ,
53+ < div >
54+ < span > A new version of Source Academy is available. </ span >
55+ < Button
56+ onClick = { ( ) => {
57+ if ( registration && registration . waiting ) {
58+ registration . waiting . postMessage ( { type : 'SKIP_WAITING' } ) ;
59+ }
60+ window . location . reload ( ) ;
61+ } }
62+ >
63+ Refresh now
64+ </ Button >
65+ </ div > ,
5366 0
5467 ) ;
5568 }
You can’t perform that action at this time.
0 commit comments