Skip to content

Commit e818901

Browse files
committed
fix: correct nitpicks from @agonzalez-r
1 parent 089d47d commit e818901

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

app/src/main/java/com/android/periodpals/model/user/UserModelSupabase.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ class UserRepositorySupabase(private val supabase: SupabaseClient) : UserReposit
4646
withContext(Dispatchers.Main) {
4747
supabase.postgrest[USERS].select {}.decodeList<UserDto>()
4848
}
49-
Log.d(TAG, "loadUserProfile: Success")
49+
Log.d(TAG, "loadUserProfiles: Success")
5050
onSuccess(result)
5151
} 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}")
5353
onFailure(e)
5454
}
5555
}
@@ -141,11 +141,11 @@ class UserRepositorySupabase(private val supabase: SupabaseClient) : UserReposit
141141
try {
142142
withContext(Dispatchers.Main) {
143143
val file = supabase.storage.from("avatars").downloadPublic("$filePath.jpg")
144-
Log.d(TAG, "downloadFile: Success")
144+
Log.d(TAG, "downloadFilePublic: Success")
145145
onSuccess(file)
146146
}
147147
} 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}")
149149
onFailure(e)
150150
}
151151
}

app/src/main/java/com/android/periodpals/model/user/UserViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ class UserViewModel(private val userRepository: UserRepositorySupabase) : ViewMo
6161
}
6262

6363
private val _user = mutableStateOf<User?>(null)
64+
val user: State<User?> = _user
6465
private val _users = mutableStateOf<List<User>?>(null)
6566
val users: State<List<User>?> = _users
66-
val user: State<User?> = _user
6767
private val _avatar = mutableStateOf<ByteArray?>(null)
6868
val avatar: State<ByteArray?> = _avatar
6969

app/src/main/java/com/android/periodpals/ui/profile/ProfileScreen.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,8 @@ fun init(
239239
authenticationViewModel: AuthenticationViewModel,
240240
chatViewModel: ChatViewModel,
241241
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
246244
) {
247245
// Load the user's authentication data and connect the user to the chat services
248246
authenticationViewModel.loadAuthenticationUserData(

0 commit comments

Comments
 (0)