Skip to content

Commit 6114495

Browse files
committed
Fix: Deprecation warning & localStorage quota handling
- Remove deprecated apple-mobile-web-app-capable - Limit generations to 20 instead of 50 - Auto-cleanup when quota exceeded - Better error messages
1 parent 656eb63 commit 6114495

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
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

js/app.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)