File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
apps/web/client/src/app/project/[id]/_components/bottom-bar Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,14 @@ export const RestartSandboxButton = observer(({
8181
8282 const handleRestartSandbox = async ( ) => {
8383 try {
84+ if ( restarting ) {
85+ return ;
86+ }
8487 const activeBranch = branches . activeBranch ;
85- if ( ! activeBranch || restarting ) return ;
88+ if ( ! activeBranch ) return ;
89+ if ( restarting ) {
90+ return ;
91+ }
8692
8793 setRestarting ( true ) ;
8894 setHasSandboxError ( false ) ;
@@ -97,7 +103,6 @@ export const RestartSandboxButton = observer(({
97103
98104 const success = await sandbox . session . restartDevServer ( ) ;
99105 if ( success ) {
100- toast . loading ( 'Restarting sandbox...' ) ;
101106 // Wait 5 seconds before refreshing webviews to avoid 502 errors
102107 setTimeout ( ( ) => {
103108 const frames = editorEngine . frames . getByBranchId ( activeBranch . id ) ;
@@ -119,8 +124,6 @@ export const RestartSandboxButton = observer(({
119124 } catch ( error ) {
120125 console . error ( 'Error restarting sandbox:' , error ) ;
121126 toast . error ( 'An error occurred while restarting the sandbox' ) ;
122- } finally {
123- toast . dismiss ( ) ;
124127 setRestarting ( false ) ;
125128 }
126129 } ;
You can’t perform that action at this time.
0 commit comments