File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ export const Route = createRootRouteWithContext<MyRouterContext>()({
7171function RemoveDB ( ) {
7272 const [ errorMessage , setErrorMessage ] = useState < string | null > ( null ) ;
7373
74+ const [ showReloadButton , setShowReloadButton ] = useState ( false ) ;
75+
7476 const removeDB = useCallback ( async ( ) => {
7577 if ( typeof window !== "undefined" && "indexedDB" in window ) {
7678 try {
@@ -86,8 +88,9 @@ function RemoveDB() {
8688 setErrorMessage ( errorMessage ) ;
8789 } ;
8890 request . onblocked = ( ) => {
91+ setShowReloadButton ( true ) ;
8992 const errorMessage =
90- "Database deletion blocked - close other tabs using this site" ;
93+ "Database deletion blocked - close other tabs using this site. If this site is not open in other tabs, try refreshing the page. " ;
9194 setErrorMessage ( errorMessage ) ;
9295 console . warn ( errorMessage ) ;
9396 } ;
@@ -110,6 +113,17 @@ function RemoveDB() {
110113 < RotateCwIcon /> Reset the db
111114 </ Button >
112115 < p className = "text-destructive font-bold text-center" > { errorMessage } </ p >
116+ { showReloadButton && (
117+ < Button
118+ className = "mx-auto"
119+ variant = "outline"
120+ onClick = { ( ) => {
121+ window . location . reload ( ) ;
122+ } }
123+ >
124+ Reload page
125+ </ Button >
126+ ) }
113127 </ ClientOnly >
114128 ) ;
115129}
You can’t perform that action at this time.
0 commit comments