Skip to content

Commit

Permalink
Attempt to fix regression on preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Oct 14, 2024
1 parent 4708b75 commit 88b41ce
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
Expand Down Expand Up @@ -163,6 +164,14 @@ fun RoomMembersModerationView(
)
}
}
is AsyncAction.Loading -> {
// Note: keeping this code only for the preview. This async indicator is now enqueued when the user confirm the unban action.
if (LocalInspectionMode.current) {
asyncIndicatorState.enqueue {
AsyncIndicator.Loading(text = stringResource(R.string.screen_room_member_list_unbanning_user, "Alice"))
}
}
}
is AsyncAction.Failure -> {
Timber.e(action.error, "Failed to unban user.")
LaunchedEffect(action) {
Expand All @@ -176,7 +185,6 @@ fun RoomMembersModerationView(
is AsyncAction.Success -> {
LaunchedEffect(action) { asyncIndicatorState.clear() }
}
is AsyncAction.Loading,
AsyncAction.Uninitialized -> Unit
}
}
Expand Down

0 comments on commit 88b41ce

Please sign in to comment.