Add delete functionality and clear adventures

This commit is contained in:
Sean Morley
2024-03-31 16:58:02 +00:00
parent adb655bf30
commit 2e26e3712d
3 changed files with 23 additions and 49 deletions

View File

@@ -65,4 +65,11 @@ export function getNumberOfAdventures() {
return adventures.length;
}
export function clearAdventures() {
adventures = [];
if (isBrowser) {
localStorage.setItem('adventures', JSON.stringify(adventures));
}
}