File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -708,14 +708,14 @@ async function compile({
708708
709709 hadError = true ;
710710 } finally {
711- try {
712- setTimeout ( ( ) => {
711+ setTimeout ( ( ) => {
712+ try {
713713 // Set a timeout so there's a chance that we also catch runtime errors
714714 localStorage . removeItem ( 'running' ) ;
715- } , 600 ) ;
716- } catch ( e ) {
717- /* no */
718- }
715+ } catch ( e ) {
716+ /* no */
717+ }
718+ } , 600 ) ;
719719
720720 if ( manager ) {
721721 const managerState = {
Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ import { show404 } from 'sandbox-hooks/not-found-screen';
1818
1919import compile , { getCurrentManager } from './compile' ;
2020
21+ Object . defineProperty ( window , 'localStorage' , {
22+ get ( ) {
23+ return { } ;
24+ } ,
25+ } ) ;
26+ Object . defineProperty ( window , 'indexedDB' , {
27+ get ( ) {
28+ return { } ;
29+ } ,
30+ } ) ;
31+
2132// Call this before importing React (or any other packages that might import React).
2233initialize ( window ) ;
2334
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ function registerValidSW(
7676 } else if ( installingWorker . state === 'redundant' ) {
7777 if ( 'storage' in navigator && 'estimate' in navigator . storage ) {
7878 navigator . storage . estimate ( ) . then ( results => {
79- const percentUsed = ( results . usage / results . quota ) * 100 ;
79+ const percentUsed = results . usage / results . quota ;
8080 // Let's assume that if we're using 95% of our quota, then this failure
8181 // was due to quota exceeded errors.
8282 // TODO: Hardcoding a threshold stinks.
You can’t perform that action at this time.
0 commit comments