Remove group (Fix #38)

This commit is contained in:
Sebastien Castiel
2024-01-11 10:12:03 -05:00
parent f20ebd5bdd
commit cf41048aea
2 changed files with 76 additions and 5 deletions

View File

@@ -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