File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
app/src/main/java/com/android/periodpals Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ class UserRepositorySupabase(private val supabase: SupabaseClient) : UserReposit
46
46
withContext(Dispatchers .Main ) {
47
47
supabase.postgrest[USERS ].select {}.decodeList<UserDto >()
48
48
}
49
- Log .d(TAG , " loadUserProfile : Success" )
49
+ Log .d(TAG , " loadUserProfiles : Success" )
50
50
onSuccess(result)
51
51
} catch (e: Exception ) {
52
- Log .d(TAG , " loadUserProfile : fail to load user profile: ${e.message} " )
52
+ Log .d(TAG , " loadUserProfiles : fail to load user profile: ${e.message} " )
53
53
onFailure(e)
54
54
}
55
55
}
@@ -141,11 +141,11 @@ class UserRepositorySupabase(private val supabase: SupabaseClient) : UserReposit
141
141
try {
142
142
withContext(Dispatchers .Main ) {
143
143
val file = supabase.storage.from(" avatars" ).downloadPublic(" $filePath .jpg" )
144
- Log .d(TAG , " downloadFile : Success" )
144
+ Log .d(TAG , " downloadFilePublic : Success" )
145
145
onSuccess(file)
146
146
}
147
147
} catch (e: Exception ) {
148
- Log .d(TAG , " downloadFile : fail to download file: ${e.message} " )
148
+ Log .d(TAG , " downloadFilePublic : fail to download file: ${e.message} " )
149
149
onFailure(e)
150
150
}
151
151
}
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ class UserViewModel(private val userRepository: UserRepositorySupabase) : ViewMo
61
61
}
62
62
63
63
private val _user = mutableStateOf<User ?>(null )
64
+ val user: State <User ?> = _user
64
65
private val _users = mutableStateOf<List <User >? > (null )
65
66
val users: State <List <User >? > = _users
66
- val user: State <User ?> = _user
67
67
private val _avatar = mutableStateOf<ByteArray ?>(null )
68
68
val avatar: State <ByteArray ?> = _avatar
69
69
Original file line number Diff line number Diff line change @@ -239,10 +239,8 @@ fun init(
239
239
authenticationViewModel : AuthenticationViewModel ,
240
240
chatViewModel : ChatViewModel ,
241
241
userState : User ? ,
242
- onSuccess : () -> Unit = { Log .d(TAG , "init success callback") },
243
- onFailure : (Exception ) -> Unit = { e : Exception ->
244
- Log .d(TAG , "init failure callback: ${e.message}")
245
- },
242
+ onSuccess : () -> Unit ,
243
+ onFailure : (Exception ) -> Unit
246
244
) {
247
245
// Load the user's authentication data and connect the user to the chat services
248
246
authenticationViewModel.loadAuthenticationUserData(
You can’t perform that action at this time.
0 commit comments