diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2024-01-11 10:12:03 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2024-01-11 10:12:58 -0500 |
| commit | cf41048aeab1a64f6e686ddb5a98fe44d5aadc58 (patch) | |
| tree | ab2b87ec44e10195f26b89a7aed2921118fa035f /src/app/groups/recent-groups-helpers.ts | |
| parent | f20ebd5bdd1a52f3824048cd9bb1145c714623e2 (diff) | |
Remove group (Fix #38)
Diffstat (limited to 'src/app/groups/recent-groups-helpers.ts')
| -rw-r--r-- | src/app/groups/recent-groups-helpers.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/app/groups/recent-groups-helpers.ts b/src/app/groups/recent-groups-helpers.ts index 5ccb5ae..72c5d28 100644 --- a/src/app/groups/recent-groups-helpers.ts +++ b/src/app/groups/recent-groups-helpers.ts @@ -32,6 +32,14 @@ export function saveRecentGroup(group: RecentGroup) { ) } +export function deleteRecentGroup(group: RecentGroup) { + const recentGroups = getRecentGroups() + localStorage.setItem( + STORAGE_KEY, + JSON.stringify(recentGroups.filter((rg) => rg.id !== group.id)), + ) +} + export function getStarredGroups() { const starredGroupsJson = localStorage.getItem(STARRED_GROUPS_STORAGE_KEY) const starredGroupsRaw = starredGroupsJson |
