收集箱使用独立编辑页

This commit is contained in:
2026-07-15 22:57:00 +08:00
parent 1ff250fa17
commit 5af8038ec0
3 changed files with 110 additions and 2 deletions
+9
View File
@@ -68,6 +68,15 @@ actor ClipStore {
return clips
}
func update(_ clip: Clip) async throws {
var clips = try await loadAll()
guard let index = clips.firstIndex(where: { $0.id == clip.id }) else {
return
}
clips[index] = clip
try await persist(clips)
}
func delete(id: UUID) async throws {
var clips = try await loadAll()
clips.removeAll { $0.id == id }