File tree Expand file tree Collapse file tree 6 files changed +25
-10
lines changed Expand file tree Collapse file tree 6 files changed +25
-10
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ struct MFAEnrollView: View {
92
92
. task {
93
93
do {
94
94
error = nil
95
- enrollResponse = try await supabase. auth. mfa. enroll ( params: MFAEnrollParams ( ) )
95
+ enrollResponse = try await supabase. auth. mfa. enroll ( params: . totp ( ) )
96
96
} catch {
97
97
self . error = error
98
98
}
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ struct TodoListView: View {
81
81
do {
82
82
error = nil
83
83
todos = try await IdentifiedArrayOf (
84
- uniqueElements: supabase. database . from ( " todos " )
84
+ uniqueElements: supabase. from ( " todos " )
85
85
. select ( )
86
86
. execute ( )
87
87
. value as [ Todo ]
@@ -105,7 +105,7 @@ struct TodoListView: View {
105
105
isComplete: updatedTodo. isComplete,
106
106
ownerID: auth. currentUserID
107
107
)
108
- updatedTodo = try await supabase. database . from ( " todos " )
108
+ updatedTodo = try await supabase. from ( " todos " )
109
109
. update ( updateRequest, returning: . representation)
110
110
. eq ( " id " , value: updatedTodo. id)
111
111
. single ( )
@@ -129,9 +129,9 @@ struct TodoListView: View {
129
129
130
130
todos. remove ( atOffsets: offset)
131
131
132
- try await supabase. database . from ( " todos " )
132
+ try await supabase. from ( " todos " )
133
133
. delete ( )
134
- . in ( " id " , value : todosToDelete. map ( \. id) )
134
+ . in ( " id " , values : todosToDelete. map ( \. id) )
135
135
. execute ( )
136
136
} catch {
137
137
self . error = error
Original file line number Diff line number Diff line change @@ -27,7 +27,12 @@ final class ChannelStore {
27
27
let insertions = channel. postgresChange ( InsertAction . self, table: " channels " )
28
28
let deletions = channel. postgresChange ( DeleteAction . self, table: " channels " )
29
29
30
- await channel. subscribe ( )
30
+ do {
31
+ try await channel. subscribeWithError ( )
32
+ } catch {
33
+ print ( " Error subscribing to channel: \( error) " )
34
+ return
35
+ }
31
36
32
37
Task {
33
38
for await insertion in insertions {
Original file line number Diff line number Diff line change @@ -109,7 +109,12 @@ final class MessageStore {
109
109
let updates = channel. postgresChange ( UpdateAction . self, table: " messages " )
110
110
let deletions = channel. postgresChange ( DeleteAction . self, table: " messages " )
111
111
112
- await channel. subscribe ( )
112
+ do {
113
+ try await channel. subscribeWithError ( )
114
+ } catch {
115
+ print ( " Error subscribing to channel: \( error) " )
116
+ return
117
+ }
113
118
114
119
Task {
115
120
for await insertion in insertions {
Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ final class UserStore {
24
24
25
25
let presences = channel. presenceChange ( )
26
26
27
- await channel. subscribe ( )
27
+ do {
28
+ try await channel. subscribeWithError ( )
29
+ } catch {
30
+ print ( " Error subscribing to channel: \( error) " )
31
+ return
32
+ }
28
33
29
34
Task {
30
35
let statusChange = channel. statusChange
Original file line number Diff line number Diff line change @@ -172,8 +172,8 @@ struct ProfileView: View {
172
172
try await supabase. storage
173
173
. from ( " avatars " )
174
174
. upload (
175
- path : filePath,
176
- file : data,
175
+ filePath,
176
+ data : data,
177
177
options: FileOptions ( contentType: " image/jpeg " , upsert: true )
178
178
)
179
179
You can’t perform that action at this time.
0 commit comments