Fix ktlint issues

This commit is contained in:
Benoit Marty 2024-01-10 19:33:39 +01:00
parent 140a11cf77
commit a831f05f6e
100 changed files with 66 additions and 158 deletions

View file

@ -36,7 +36,6 @@ class LoggedInEventProcessor @Inject constructor(
roomMembershipObserver: RoomMembershipObserver,
sessionVerificationService: SessionVerificationService,
) {
private var observingJob: Job? = null
private val displayLeftRoomMessage = roomMembershipObserver.updates

View file

@ -111,7 +111,6 @@ class LoggedInFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
interface Callback : Plugin {
fun onOpenBugReport()
}

View file

@ -81,7 +81,6 @@ class RootFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
override fun onBuilt() {
matrixClientsHolder.restoreWithSavedState(buildContext.savedStateMap)
super.onBuilt()

View file

@ -37,7 +37,6 @@ private const val SAVE_INSTANCE_KEY = "io.element.android.x.di.MatrixClientsHold
@SingleIn(AppScope::class)
@ContributesBinding(AppScope::class)
class MatrixClientsHolder @Inject constructor(private val authenticationService: MatrixAuthenticationService) : MatrixClientProvider {
private val sessionIdsToMatrixClient = ConcurrentHashMap<SessionId, MatrixClient>()
private val restoreMutex = Mutex()

View file

@ -1,21 +0,0 @@
/*
* Copyright (c) 2023 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.appnav.loggedin
// sealed interface LoggedInEvents {
// data object MyEvent : LoggedInEvents
// }

View file

@ -35,7 +35,6 @@ class LoggedInNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
@Composable
override fun View(modifier: Modifier) {
val loggedInState = loggedInPresenter.present()

View file

@ -35,7 +35,6 @@ class LoggedInPresenter @Inject constructor(
private val networkMonitor: NetworkMonitor,
private val pushService: PushService,
) : Presenter<LoggedInState> {
@Composable
override fun present(): LoggedInState {
LaunchedEffect(Unit) {

View file

@ -47,7 +47,6 @@ open class LoadingRoomStateProvider : PreviewParameterProvider<LoadingRoomState>
@SingleIn(SessionScope::class)
class LoadingRoomStateFlowFactory @Inject constructor(private val matrixClient: MatrixClient) {
fun create(lifecycleScope: CoroutineScope, roomId: RoomId): StateFlow<LoadingRoomState> =
getRoomFlow(roomId)
.map { room ->

View file

@ -66,7 +66,6 @@ class RoomFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins
) {
data class Inputs(
val roomId: RoomId,
val initialElement: RoomLoadedFlowNode.NavTarget = RoomLoadedFlowNode.NavTarget.Messages,

View file

@ -71,7 +71,6 @@ class RoomLoadedFlowNode @AssistedInject constructor(
buildContext = buildContext,
plugins = plugins,
), DaggerComponentOwner {
interface Callback : Plugin {
fun onOpenRoom(roomId: RoomId)
fun onForwardedToSingleRoom(roomId: RoomId)

View file

@ -41,7 +41,6 @@ class RootNavStateFlowFactory @Inject constructor(
private val matrixClientsHolder: MatrixClientsHolder,
private val loginUserStory: LoginUserStory,
) {
private var currentCacheIndex = 0
fun create(savedStateMap: SavedStateMap?): Flow<RootNavState> {

View file

@ -30,7 +30,6 @@ class RootPresenter @Inject constructor(
private val rageshakeDetectionPresenter: RageshakeDetectionPresenter,
private val appErrorStateService: AppErrorStateService,
) : Presenter<RootState> {
@Composable
override fun present(): RootState {
val rageshakeDetectionState = rageshakeDetectionPresenter.present()

View file

@ -41,7 +41,6 @@ import org.junit.Rule
import org.junit.Test
class RoomFlowNodeTest {
@get:Rule
val instantTaskExecutorRule = InstantTaskExecutorRule()
@ -49,7 +48,6 @@ class RoomFlowNodeTest {
val mainDispatcherRule = MainDispatcherRule()
private class FakeMessagesEntryPoint : MessagesEntryPoint {
var nodeId: String? = null
var callback: MessagesEntryPoint.Callback? = null
@ -68,12 +66,10 @@ class RoomFlowNodeTest {
}
private class FakeRoomDetailsEntryPoint : RoomDetailsEntryPoint {
var nodeId: String? = null
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
return object : RoomDetailsEntryPoint.NodeBuilder {
override fun params(params: RoomDetailsEntryPoint.Params): RoomDetailsEntryPoint.NodeBuilder {
return this
}

View file

@ -36,7 +36,6 @@ import org.junit.Rule
import org.junit.Test
class LoggedInPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

View file

@ -28,7 +28,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class LoadingRoomStateFlowFactoryTest {
@Test
fun `flow should emit Loading and then Loaded when there is a room in cache`() = runTest {
val room = FakeMatrixRoom(sessionId = A_SESSION_ID, roomId = A_ROOM_ID)