Fixed sheet local storage

This commit is contained in:
Roman Krček
2025-08-06 14:35:12 +02:00
parent 7fb72c7d75
commit c6cc9c6658
7 changed files with 309 additions and 579 deletions

View File

@@ -50,19 +50,6 @@
}
}
function saveRecentSheet(sheet) {
// Remove duplicates
recentSheets = recentSheets.filter(s => s.id !== sheet.id);
recentSheets.unshift(sheet);
// Limit to 5 recent sheets
if (recentSheets.length > 5) {
recentSheets.pop();
}
localStorage.setItem(RECENT_SHEETS_KEY, JSON.stringify(recentSheets));
}
function handleSelectSheet(sheet) {
const sheetData: SheetInfoType = {
id: sheet.id,
@@ -270,6 +257,5 @@
textBack="Back to Auth"
textForwardDisabled="Select a sheet"
textForwardEnabled="Continue"
onForward={() => saveRecentSheet($selectedSheet)}
/>
</div>