diff --git a/app/src/main/java/com/jerboa/model/CommunityViewModel.kt b/app/src/main/java/com/jerboa/model/CommunityViewModel.kt index 6ac5856df..de8c9cdf8 100644 --- a/app/src/main/java/com/jerboa/model/CommunityViewModel.kt +++ b/app/src/main/java/com/jerboa/model/CommunityViewModel.kt @@ -242,11 +242,11 @@ class CommunityViewModel : ViewModel(), Initializable { } } } - fun unblockCommunity(form: UnblockCommunity, ctx: Context){ + fun unblockCommunity(form: UnblockCommunity, ctx: Context) { viewModelScope.launch { unblockCommunityRes = ApiState.Loading unblockCommunityRes - apiWrapper(API.getInstance().unblockCommunity(form)) + apiWrapper(API.getInstance().unblockCommunity(form)) when (val unblockCommunity = unblockCommunityRes) { is ApiState.Success -> { showUnblockCommunityToast(unblockCommunity, ctx) diff --git a/app/src/main/java/com/jerboa/ui/components/community/Community.kt b/app/src/main/java/com/jerboa/ui/components/community/Community.kt index b8adb887d..f7dd438ba 100644 --- a/app/src/main/java/com/jerboa/ui/components/community/Community.kt +++ b/app/src/main/java/com/jerboa/ui/components/community/Community.kt @@ -264,7 +264,7 @@ fun CommunityMoreDropdown( expanded: Boolean, onDismissRequest: () -> Unit, onBlockCommunityClick: () -> Unit, - onUnblockCommunityClick:() -> Unit, + onUnblockCommunityClick: () -> Unit, onClickRefresh: () -> Unit, onClickCommunityInfo: () -> Unit, onClickShowPostViewModeDialog: () -> Unit, diff --git a/app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt b/app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt index dcd447ac1..12dfed75a 100644 --- a/app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt +++ b/app/src/main/java/com/jerboa/ui/components/home/HomeActivity.kt @@ -350,7 +350,7 @@ fun MainPostListingsContent( ctx, snackbarHostState, scope, - siteViewModel + siteViewModel, ) { homeViewModel.unblockCommunity( UnblockCommunity( diff --git a/app/src/main/java/com/jerboa/ui/components/person/PersonProfileActivity.kt b/app/src/main/java/com/jerboa/ui/components/person/PersonProfileActivity.kt index ad4cdadb7..85b2cc5e1 100644 --- a/app/src/main/java/com/jerboa/ui/components/person/PersonProfileActivity.kt +++ b/app/src/main/java/com/jerboa/ui/components/person/PersonProfileActivity.kt @@ -57,7 +57,6 @@ import com.jerboa.datatypes.getDisplayName import com.jerboa.datatypes.types.BlockCommunity import com.jerboa.datatypes.types.BlockPerson import com.jerboa.datatypes.types.CommentView -import com.jerboa.datatypes.types.CommunityId import com.jerboa.datatypes.types.CreateCommentLike import com.jerboa.datatypes.types.CreatePostLike import com.jerboa.datatypes.types.DeleteComment @@ -599,13 +598,16 @@ fun UserTabs( ctx, snackbarHostState, scope, - loginAsToast = true) { + loginAsToast = true, + ) { personProfileViewModel.unblockCommunity( UnblockCommunity( community_id = community.id, block = false, - auth = it.jwt), - ctx) + auth = it.jwt, + ), + ctx, + ) } }, diff --git a/app/src/main/java/com/jerboa/ui/components/post/PostListing.kt b/app/src/main/java/com/jerboa/ui/components/post/PostListing.kt index 58c3acc16..df0378571 100644 --- a/app/src/main/java/com/jerboa/ui/components/post/PostListing.kt +++ b/app/src/main/java/com/jerboa/ui/components/post/PostListing.kt @@ -895,7 +895,7 @@ fun PreviewImagePostListingCard() { onReportClick = {}, onPersonClick = {}, onBlockCommunityClick = {}, - onUnblockCommunityClick= {}, + onUnblockCommunityClick = {}, onBlockCreatorClick = {}, onShareClick = {}, isModerator = false, @@ -933,7 +933,7 @@ fun PreviewImagePostListingSmallCard() { onReportClick = {}, onPersonClick = {}, onBlockCommunityClick = {}, - onUnblockCommunityClick= {}, + onUnblockCommunityClick = {}, onBlockCreatorClick = {}, onShareClick = {}, isModerator = false, @@ -1007,7 +1007,7 @@ fun PostListing( onReportClick: (postView: PostView) -> Unit, onPersonClick: (personId: Int) -> Unit, onBlockCommunityClick: (community: Community) -> Unit, - onUnblockCommunityClick: (community:Community) -> Unit, + onUnblockCommunityClick: (community: Community) -> Unit, onBlockCreatorClick: (person: Person) -> Unit, onShareClick: (url: String) -> Unit, showReply: Boolean = false, diff --git a/app/src/main/java/com/jerboa/ui/components/post/PostListings.kt b/app/src/main/java/com/jerboa/ui/components/post/PostListings.kt index 9aa2bbf02..a662666ec 100644 --- a/app/src/main/java/com/jerboa/ui/components/post/PostListings.kt +++ b/app/src/main/java/com/jerboa/ui/components/post/PostListings.kt @@ -98,7 +98,7 @@ fun PostListings( onReportClick = onReportClick, onPersonClick = onPersonClick, onBlockCommunityClick = onBlockCommunityClick, - onUnblockCommunityClick= onUnblockCommunityClick, + onUnblockCommunityClick = onUnblockCommunityClick, onBlockCreatorClick = onBlockCreatorClick, onShareClick = onShareClick, isModerator = false, diff --git a/app/src/main/java/com/jerboa/util/Initializable.kt b/app/src/main/java/com/jerboa/util/Initializable.kt index bccedd3b9..885f1cd2c 100644 --- a/app/src/main/java/com/jerboa/util/Initializable.kt +++ b/app/src/main/java/com/jerboa/util/Initializable.kt @@ -1,6 +1,5 @@ package com.jerboa.util -import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import kotlinx.coroutines.CoroutineScope