Skip to content

Commit 190531d

Browse files
committed
Code quality
1 parent 2f10fa8 commit 190531d

File tree

10 files changed

+13
-14
lines changed

10 files changed

+13
-14
lines changed

appnav/src/main/kotlin/io/element/android/appnav/RootFlowNode.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class RootFlowNode(
293293
}
294294
is NavTarget.AccountSelect -> {
295295
val callback: AccountSelectEntryPoint.Callback = object : AccountSelectEntryPoint.Callback {
296-
override fun onAccountSelected(sessionId: SessionId) {
296+
override fun onSelectAccount(sessionId: SessionId) {
297297
lifecycleScope.launch {
298298
if (sessionId == navTarget.currentSessionId) {
299299
// Ensure that the account selection Node is removed from the backstack

features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/root/PreferencesRootView.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,3 @@ internal fun MultiAccountSectionPreview() = ElementPreview {
359359
)
360360
}
361361
}
362-

features/signedout/impl/src/main/kotlin/io/element/android/features/signedout/impl/SignedOutStateProvider.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ package io.element.android.features.signedout.impl
1010
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
1111
import io.element.android.libraries.sessionstorage.api.LoginType
1212
import io.element.android.libraries.sessionstorage.api.SessionData
13-
import java.util.Date
1413

1514
open class SignedOutStateProvider : PreviewParameterProvider<SignedOutState> {
1615
override val values: Sequence<SignedOutState>

libraries/accountselect/api/src/main/kotlin/io/element/android/libraries/accountselect/api/AccountSelectEntryPoint.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface AccountSelectEntryPoint : FeatureEntryPoint {
2222
}
2323

2424
interface Callback : Plugin {
25-
fun onAccountSelected(sessionId: SessionId)
25+
fun onSelectAccount(sessionId: SessionId)
2626
fun onCancel()
2727
}
2828
}

libraries/accountselect/impl/src/main/kotlin/io/element/android/libraries/accountselect/impl/AccountSelectNode.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class AccountSelectNode @AssistedInject constructor(
3131
callbacks.forEach { it.onCancel() }
3232
}
3333

34-
private fun onAccountSelected(sessionId: SessionId) {
35-
callbacks.forEach { it.onAccountSelected(sessionId) }
34+
private fun onSelectAccount(sessionId: SessionId) {
35+
callbacks.forEach { it.onSelectAccount(sessionId) }
3636
}
3737

3838
@Composable
@@ -41,7 +41,7 @@ class AccountSelectNode @AssistedInject constructor(
4141
AccountSelectView(
4242
state = state,
4343
onDismiss = ::onDismiss,
44-
onAccountSelected = ::onAccountSelected,
44+
onSelectAccount = ::onSelectAccount,
4545
modifier = modifier,
4646
)
4747
}

libraries/accountselect/impl/src/main/kotlin/io/element/android/libraries/accountselect/impl/AccountSelectView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import io.element.android.libraries.matrix.ui.components.MatrixUserRow
3434
@Composable
3535
fun AccountSelectView(
3636
state: AccountSelectState,
37-
onAccountSelected: (SessionId) -> Unit,
37+
onSelectAccount: (SessionId) -> Unit,
3838
onDismiss: () -> Unit,
3939
modifier: Modifier = Modifier,
4040
) {
@@ -63,7 +63,7 @@ fun AccountSelectView(
6363
modifier = Modifier
6464
.fillMaxWidth()
6565
.clickable {
66-
onAccountSelected(matrixUser.userId)
66+
onSelectAccount(matrixUser.userId)
6767
}
6868
.padding(vertical = 8.dp),
6969
matrixUser = matrixUser,
@@ -81,7 +81,7 @@ fun AccountSelectView(
8181
internal fun AccountSelectViewPreview(@PreviewParameter(AccountSelectStateProvider::class) state: AccountSelectState) = ElementPreview {
8282
AccountSelectView(
8383
state = state,
84-
onAccountSelected = {},
84+
onSelectAccount = {},
8585
onDismiss = {},
8686
)
8787
}

libraries/session-storage/api/src/main/kotlin/io/element/android/libraries/sessionstorage/api/SessionData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ data class SessionData(
3939
val sessionPath: String,
4040
/** The path to the cache data stored for the session in the filesystem. */
4141
val cachePath: String,
42-
/** The position, to be able to order account */
42+
/** The position, to be able to order account. */
4343
val position: Long,
4444
/** The index of the last date of session usage. */
4545
val lastUsageIndex: Long,

libraries/session-storage/impl/src/main/kotlin/io/element/android/libraries/sessionstorage/impl/DatabaseSessionStore.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ class DatabaseSessionStore(
133133
private fun getLastUsageIndex(): Long {
134134
return database.sessionDataQueries.selectLatest()
135135
.executeAsOneOrNull()
136-
?.lastUsageIndex ?: 0L
136+
?.lastUsageIndex
137+
?: 0L
137138
}
138139

139140
override suspend fun getLatestSession(): SessionData? {

libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryEvents.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ import io.element.android.libraries.matrix.api.core.SessionId
1414
sealed interface PushHistoryEvents {
1515
data class SetShowOnlyErrors(val showOnlyErrors: Boolean) : PushHistoryEvents
1616
data class Reset(val requiresConfirmation: Boolean) : PushHistoryEvents
17-
data class NavigateTo(val sessionId: SessionId, val roomId: RoomId, val eventId: EventId): PushHistoryEvents
17+
data class NavigateTo(val sessionId: SessionId, val roomId: RoomId, val eventId: EventId) : PushHistoryEvents
1818
data object ClearDialog : PushHistoryEvents
1919
}

libraries/troubleshoot/impl/src/main/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryPresenter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class PushHistoryPresenter(
5959
}
6060
}.collectAsState(emptyList())
6161
var resetAction: AsyncAction<Unit> by remember { mutableStateOf(AsyncAction.Uninitialized) }
62-
var showNotSameAccountError by remember { mutableStateOf(false) }
62+
var showNotSameAccountError by remember { mutableStateOf(false) }
6363

6464
fun handleEvents(event: PushHistoryEvents) {
6565
when (event) {

0 commit comments

Comments
 (0)