File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,14 +103,16 @@ const Terminal = forwardRef<TerminalHandle, TerminalProps>(
103103 writePrompt ( ) ;
104104 } else if ( cmd === 'reset' ) {
105105 term . writeln ( '\x1b[33mClearing room data...\x1b[0m' ) ;
106- const dbNames = await indexedDB . databases ?.( ) ?? [ ] ;
107- for ( const db of dbNames ) {
108- if ( db . name && db . name . startsWith ( 'collab-code-' ) ) {
109- indexedDB . deleteDatabase ( db . name ) ;
106+ ( async ( ) => {
107+ const dbNames = await indexedDB . databases ?.( ) ?? [ ] ;
108+ for ( const db of dbNames ) {
109+ if ( db . name && db . name . startsWith ( 'collab-code-' ) ) {
110+ indexedDB . deleteDatabase ( db . name ) ;
111+ }
110112 }
111- }
112- term . writeln ( '\x1b[32mDone. Reloading...\x1b[0m' ) ;
113- setTimeout ( ( ) => window . location . reload ( ) , 500 ) ;
113+ term . writeln ( '\x1b[32mDone. Reloading...\x1b[0m' ) ;
114+ setTimeout ( ( ) => window . location . reload ( ) , 500 ) ;
115+ } ) ( ) ;
114116 } else if ( cmd === 'help' ) {
115117 term . writeln ( ' \x1b[1;32mrun\x1b[0m — compile & execute Java' ) ;
116118 term . writeln ( ' \x1b[1;32mclear\x1b[0m — clear terminal' ) ;
You can’t perform that action at this time.
0 commit comments