Fix moar ktlint issues
This commit is contained in:
parent
a831f05f6e
commit
5d086ad82d
528 changed files with 146 additions and 629 deletions
|
|
@ -30,7 +30,6 @@ class DefaultEndPollAction @Inject constructor(
|
|||
private val room: MatrixRoom,
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : EndPollAction {
|
||||
|
||||
override suspend fun execute(pollStartId: EventId): Result<Unit> {
|
||||
return room.endPoll(
|
||||
pollStartId = pollStartId,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ class DefaultSendPollResponseAction @Inject constructor(
|
|||
private val room: MatrixRoom,
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : SendPollResponseAction {
|
||||
|
||||
override suspend fun execute(pollStartId: EventId, answerId: String): Result<Unit> {
|
||||
return room.sendPollResponse(
|
||||
pollStartId = pollStartId,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ class CreatePollNode @AssistedInject constructor(
|
|||
presenterFactory: CreatePollPresenter.Factory,
|
||||
analyticsService: AnalyticsService,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
data class Inputs(val mode: CreatePollMode) : NodeInputs
|
||||
|
||||
private val inputs: Inputs = inputs()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ class CreatePollPresenter @AssistedInject constructor(
|
|||
@Assisted private val navigateUp: () -> Unit,
|
||||
@Assisted private val mode: CreatePollMode,
|
||||
) : Presenter<CreatePollState> {
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory {
|
||||
fun create(backNavigator: () -> Unit, mode: CreatePollMode): CreatePollPresenter
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ class DefaultCreatePollEntryPoint @Inject constructor() : CreatePollEntryPoint {
|
|||
val plugins = ArrayList<Plugin>()
|
||||
|
||||
return object : CreatePollEntryPoint.NodeBuilder {
|
||||
|
||||
override fun params(params: CreatePollEntryPoint.Params): CreatePollEntryPoint.NodeBuilder {
|
||||
plugins += CreatePollNode.Inputs(mode = params.mode)
|
||||
return this
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ class PollHistoryFlowNode @AssistedInject constructor(
|
|||
buildContext = buildContext,
|
||||
plugins = plugins
|
||||
) {
|
||||
|
||||
sealed interface NavTarget : Parcelable {
|
||||
@Parcelize
|
||||
data object Root : NavTarget
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ class PollHistoryNode @AssistedInject constructor(
|
|||
buildContext = buildContext,
|
||||
plugins = plugins,
|
||||
) {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onEditPoll(pollStartEventId: EventId)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ class PollHistoryPresenter @Inject constructor(
|
|||
private val endPollAction: EndPollAction,
|
||||
private val pollHistoryItemFactory: PollHistoryItemsFactory,
|
||||
) : Presenter<PollHistoryState> {
|
||||
|
||||
@Composable
|
||||
override fun present(): PollHistoryState {
|
||||
// TODO use room.rememberPollHistory() when working properly?
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ data class PollHistoryState(
|
|||
val pollHistoryItems: PollHistoryItems,
|
||||
val eventSink: (PollHistoryEvents) -> Unit,
|
||||
) {
|
||||
|
||||
fun pollHistoryForFilter(filter: PollHistoryFilter): ImmutableList<PollHistoryItem> {
|
||||
return when (filter) {
|
||||
PollHistoryFilter.ONGOING -> pollHistoryItems.ongoing
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ class PollHistoryItemsFactory @Inject constructor(
|
|||
private val daySeparatorFormatter: DaySeparatorFormatter,
|
||||
private val dispatchers: CoroutineDispatchers,
|
||||
) {
|
||||
|
||||
suspend fun create(timelineItems: List<MatrixTimelineItem>): PollHistoryItems = withContext(dispatchers.computation) {
|
||||
val past = ArrayList<PollHistoryItem>()
|
||||
val ongoing = ArrayList<PollHistoryItem>()
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import javax.inject.Inject
|
|||
class DefaultPollContentStateFactory @Inject constructor(
|
||||
private val matrixClient: MatrixClient,
|
||||
) : PollContentStateFactory {
|
||||
|
||||
override suspend fun create(
|
||||
event: EventTimelineItem,
|
||||
content: PollContent
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
|
||||
class CreatePollPresenterTest {
|
||||
|
||||
@get:Rule
|
||||
val warmUpRule = WarmUpRule()
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import kotlinx.collections.immutable.toPersistentList
|
|||
import org.junit.Test
|
||||
|
||||
class PollFormStateTest {
|
||||
|
||||
@Test
|
||||
fun `with new answer`() {
|
||||
val state = PollFormState.Empty
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ import org.junit.Rule
|
|||
import org.junit.Test
|
||||
|
||||
class PollHistoryPresenterTest {
|
||||
|
||||
@get:Rule
|
||||
val warmUpRule = WarmUpRule()
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ import kotlinx.coroutines.test.runTest
|
|||
import org.junit.Test
|
||||
|
||||
class PollContentStateFactoryTest {
|
||||
|
||||
private val factory = DefaultPollContentStateFactory(FakeMatrixClient())
|
||||
private val eventTimelineItem = anEventTimelineItem()
|
||||
|
||||
|
|
@ -281,15 +280,20 @@ class PollContentStateFactoryTest {
|
|||
|
||||
private val MY_USER_WINNING_VOTES = persistentMapOf(
|
||||
A_POLL_ANSWER_1 to persistentListOf(A_USER_ID_2, A_USER_ID_3, A_USER_ID_4),
|
||||
A_POLL_ANSWER_2 to persistentListOf(A_USER_ID /* my vote */, A_USER_ID_5, A_USER_ID_6, A_USER_ID_7, A_USER_ID_8, A_USER_ID_9), // winner
|
||||
// First item (A_USER_ID) is for my vote
|
||||
// winner
|
||||
A_POLL_ANSWER_2 to persistentListOf(A_USER_ID, A_USER_ID_5, A_USER_ID_6, A_USER_ID_7, A_USER_ID_8, A_USER_ID_9),
|
||||
A_POLL_ANSWER_3 to persistentListOf(),
|
||||
A_POLL_ANSWER_4 to persistentListOf(A_USER_ID_10),
|
||||
)
|
||||
private val OTHER_WINNING_VOTES = persistentMapOf(
|
||||
A_POLL_ANSWER_1 to persistentListOf(A_USER_ID_2, A_USER_ID_3, A_USER_ID_4, A_USER_ID_5), // winner
|
||||
A_POLL_ANSWER_2 to persistentListOf(A_USER_ID /* my vote */, A_USER_ID_6),
|
||||
// A winner
|
||||
A_POLL_ANSWER_1 to persistentListOf(A_USER_ID_2, A_USER_ID_3, A_USER_ID_4, A_USER_ID_5),
|
||||
// First item (A_USER_ID) is for my vote
|
||||
A_POLL_ANSWER_2 to persistentListOf(A_USER_ID, A_USER_ID_6),
|
||||
A_POLL_ANSWER_3 to persistentListOf(),
|
||||
A_POLL_ANSWER_4 to persistentListOf(A_USER_ID_7, A_USER_ID_8, A_USER_ID_9, A_USER_ID_10), // winner
|
||||
// Other winner
|
||||
A_POLL_ANSWER_4 to persistentListOf(A_USER_ID_7, A_USER_ID_8, A_USER_ID_9, A_USER_ID_10),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue