Skip to content

Commit

Permalink
Fixed according woodpecker LemmyNet#682
Browse files Browse the repository at this point in the history
  • Loading branch information
Schoolkid1 committed Aug 13, 2023
1 parent c3d85b1 commit d183774
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/jerboa/model/CommunityViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ fun CommunityMoreDropdown(
expanded: Boolean,
onDismissRequest: () -> Unit,
onBlockCommunityClick: () -> Unit,
onUnblockCommunityClick:() -> Unit,
onUnblockCommunityClick: () -> Unit,
onClickRefresh: () -> Unit,
onClickCommunityInfo: () -> Unit,
onClickShowPostViewModeDialog: () -> Unit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ fun MainPostListingsContent(
ctx,
snackbarHostState,
scope,
siteViewModel
siteViewModel,
) {
homeViewModel.unblockCommunity(
UnblockCommunity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ fun PreviewImagePostListingCard() {
onReportClick = {},
onPersonClick = {},
onBlockCommunityClick = {},
onUnblockCommunityClick= {},
onUnblockCommunityClick = {},
onBlockCreatorClick = {},
onShareClick = {},
isModerator = false,
Expand Down Expand Up @@ -933,7 +933,7 @@ fun PreviewImagePostListingSmallCard() {
onReportClick = {},
onPersonClick = {},
onBlockCommunityClick = {},
onUnblockCommunityClick= {},
onUnblockCommunityClick = {},
onBlockCreatorClick = {},
onShareClick = {},
isModerator = false,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fun PostListings(
onReportClick = onReportClick,
onPersonClick = onPersonClick,
onBlockCommunityClick = onBlockCommunityClick,
onUnblockCommunityClick= onUnblockCommunityClick,
onUnblockCommunityClick = onUnblockCommunityClick,
onBlockCreatorClick = onBlockCreatorClick,
onShareClick = onShareClick,
isModerator = false,
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/jerboa/util/Initializable.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit d183774

Please sign in to comment.