Skip to content

Commit

Permalink
Use return triple instead of callback
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikJannsen committed Dec 9, 2024
1 parent 6c0aa6e commit e4e3d53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class NodeUserProfileServiceFacade(private val applicationService: AndroidApplic
return userService.userIdentityService.userIdentities.map { userIdentity -> userIdentity.id }
}

override suspend fun applySelectedUserProfile(result: (String?, String?, String?) -> Unit) {
override suspend fun applySelectedUserProfile():Triple<String?, String?, String?> {
val userProfile = getSelectedUserProfile()
result(userProfile?.nickName, userProfile?.nym, userProfile?.id)
return Triple(userProfile?.nickName, userProfile?.nym, userProfile?.id)
}

// Private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ class ClientUserProfileServiceFacade(
return apiGateway.getUserIdentityIds()
}

override suspend fun applySelectedUserProfile(result: (String?, String?, String?) -> Unit) {
override suspend fun applySelectedUserProfile(): Triple<String?, String?, String?> {
val userProfile = getSelectedUserProfile()
result(userProfile.nickName, userProfile.nym, userProfile.id)
return Triple(userProfile.nickName, userProfile.nym, userProfile.id)
}

// Private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ interface UserProfileServiceFacade {
/**
* Applies the selected user identity to the user profile model
*/
suspend fun applySelectedUserProfile(result: (String?, String?, String?) -> Unit)
suspend fun applySelectedUserProfile():Triple<String?, String?, String?>
}

0 comments on commit e4e3d53

Please sign in to comment.