diff options
| author | Christian Cleberg <[email protected]> | 2026-08-07 03:16:14 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-07 03:16:14 -0500 |
| commit | 6c26cf048119bf4ff6af039991d3e34d76bac2ad (patch) | |
| tree | 22c3280dca5f85923ddc3cc85bff8751ad46b7fe /Hutch/Views/Home | |
| parent | 044c33f7f43db1f38d6c44dd8f483298d9efcc06 (diff) | |
| parent | 9c11d69002d71556fea1e2a938e02d4f4d503ea5 (diff) | |
| download | hutch-6c26cf048119bf4ff6af039991d3e34d76bac2ad.tar.gz hutch-6c26cf048119bf4ff6af039991d3e34d76bac2ad.tar.bz2 hutch-6c26cf048119bf4ff6af039991d3e34d76bac2ad.zip | |
Merge pull request #31 from krazywarez/app-intents-expansion
Expand App Intents: dialogs, search type, mutating intents (#17)
Diffstat (limited to 'Hutch/Views/Home')
| -rw-r--r-- | Hutch/Views/Home/HomePinStore.swift | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Hutch/Views/Home/HomePinStore.swift b/Hutch/Views/Home/HomePinStore.swift index e9bffd1..3b00843 100644 --- a/Hutch/Views/Home/HomePinStore.swift +++ b/Hutch/Views/Home/HomePinStore.swift @@ -144,6 +144,21 @@ enum HomePinStore { saveAll(pinsByUser, defaults: defaults) } + static func removePin( + id: String, + for userKey: String, + defaults: UserDefaults = .standard + ) { + let normalizedUserKey = normalizedUserKey(userKey) + guard !normalizedUserKey.isEmpty else { return } + + var pinsByUser = loadAll(defaults: defaults) + var pins = normalizedPins(pinsByUser[normalizedUserKey] ?? loadPins(for: normalizedUserKey, defaults: defaults)) + pins.removeAll { $0.id == id } + pinsByUser[normalizedUserKey] = pins + saveAll(pinsByUser, defaults: defaults) + } + static func pinnedProjectIDs( for userKey: String, defaults: UserDefaults = .standard |
