File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030
3131 < meta name ="theme-color " content ="#0a0a0f ">
3232 < meta name ="msapplication-TileColor " content ="#0a0a0f ">
33- < meta name ="apple- mobile-web-app-capable " content ="yes ">
33+ < meta name ="mobile-web-app-capable " content ="yes ">
3434 < meta name ="apple-mobile-web-app-status-bar-style " content ="black-translucent ">
3535 < meta name ="apple-mobile-web-app-title " content ="ACE-Step-Web ">
3636
Original file line number Diff line number Diff line change @@ -607,12 +607,27 @@ function saveGeneration(generation) {
607607 const generations = saved ? JSON . parse ( saved ) : [ ] ;
608608 generations . unshift ( generation ) ;
609609
610- if ( generations . length > 50 ) {
611- generations . pop ( ) ;
610+ if ( generations . length > 20 ) {
611+ generations . length = 20 ;
612612 }
613613
614- localStorage . setItem ( 'acestep_generations' , JSON . stringify ( generations ) ) ;
615- renderGenerations ( generations ) ;
614+ try {
615+ localStorage . setItem ( 'acestep_generations' , JSON . stringify ( generations ) ) ;
616+ renderGenerations ( generations ) ;
617+ } catch ( quotaError ) {
618+ while ( generations . length > 5 ) {
619+ generations . pop ( ) ;
620+ try {
621+ localStorage . setItem ( 'acestep_generations' , JSON . stringify ( generations ) ) ;
622+ renderGenerations ( generations ) ;
623+ toast ( 'Storage full - older generations removed' , 'warning' ) ;
624+ return ;
625+ } catch ( e ) {
626+ continue ;
627+ }
628+ }
629+ toast ( 'Storage full - please clear some generations' , 'error' ) ;
630+ }
616631 } catch ( e ) {
617632 console . error ( 'Error saving generation:' , e ) ;
618633 toast ( 'Failed to save generation' , 'error' ) ;
You can’t perform that action at this time.
0 commit comments