收集箱使用独立编辑页
This commit is contained in:
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user