@@ -56,8 +56,8 @@ struct Reminder: Hashable, Identifiable {
5656extension Updates < Reminder > {
5757 mutating func toggleStatus( ) {
5858 self . status = Case ( self . status)
59- . when ( Reminder . Status . incomplete, then: Reminder . Status . completing)
60- . else ( Reminder . Status . incomplete)
59+ . when ( #bind ( . incomplete) , then: #bind ( . completing) )
60+ . else ( #bind ( . incomplete) )
6161 }
6262}
6363
@@ -101,13 +101,13 @@ extension Tag {
101101}
102102
103103@Table ( " remindersTags " )
104- struct ReminderTag : Hashable , Identifiable {
104+ struct ReminderTag : Identifiable {
105105 let id : UUID
106- var reminderID : Reminder . ID
107- var tagID : Tag . ID
106+ let reminderID : Reminder . ID
107+ let tagID : Tag . ID
108108}
109109
110- @Table @ Selection
110+ @Table
111111struct ReminderText : FTS5 {
112112 let rowid : Int
113113 let title : String
@@ -335,7 +335,7 @@ func appDatabase() throws -> any DatabaseWriter {
335335 } forEachRow: { _, _ in
336336 Values ( $handleReminderStatusUpdate ( ) )
337337 } when: { _, new in
338- new. status. eq ( Reminder . Status . completing)
338+ new. status. eq ( #bind ( . completing) )
339339 }
340340 )
341341 . execute ( db)
@@ -359,7 +359,7 @@ func handleReminderStatusUpdate() {
359359 try await clock. sleep ( for: . seconds( 5 ) )
360360 try await database. write { db in
361361 try Reminder
362- . where { $0. status. eq ( Reminder . Status . completing) }
362+ . where { $0. status. eq ( #bind ( . completing) ) }
363363 . update { $0. status = . completed }
364364 . execute ( db)
365365 }
0 commit comments